Skip to content

Commit

Permalink
fix SyntaxWarning in pytorch/libs/egs/egs.py (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
zengchang233 authored Dec 25, 2023
1 parent 1435872 commit 87f35b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pytorch/libs/egs/egs.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ def __init__(self, egs_csv, egs_type="chunk", io_status=True, aug=None, aug_para
@io_status: if false, do not read data from disk and return zero, which is useful for saving i/o resource
when kipping seed index.
"""
assert egs_type is "chunk" or egs_type is "vector"
assert egs_type == "chunk" or egs_type == "vector"
assert egs_csv != "" and egs_csv is not None
head = pd.read_csv(egs_csv, sep=" ", nrows=0).columns

assert "ark-path" in head
assert "class-label" in head

if egs_type is "chunk":
if egs_type == "chunk":
if "start-position" in head and "end-position" in head:
self.chunk_position = pd.read_csv(egs_csv, sep=" ", usecols=["start-position", "end-position"]).values
elif "start-position" not in head and "end-position" not in head:
Expand Down Expand Up @@ -82,7 +82,7 @@ def __getitem__(self, index):
else:
chunk = None

if self.egs_type is "chunk":
if self.egs_type == "chunk":
egs = kaldi_io.read_mat(egs_path, chunk=chunk)
else:
egs = kaldi_io.read_vec_flt(egs_path)
Expand Down

0 comments on commit 87f35b3

Please sign in to comment.