Skip to content

Commit

Permalink
fix sortagrad, test=asr
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackwaterveg committed Feb 15, 2022
1 parent 7f970bb commit 95d5274
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion paddlespeech/s2t/io/batchfy.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def make_batchset(
# sort it by input lengths (long to short)
sorted_data = sorted(
d.items(),
key=lambda data: int(data[1][batch_sort_key][batch_sort_axis]["shape"][0]),
key=lambda data: float(data[1][batch_sort_key][batch_sort_axis]["shape"][0]),
reverse=not shortest_first, )
logger.info("# utts: " + str(len(sorted_data)))

Expand Down
2 changes: 1 addition & 1 deletion paddlespeech/s2t/io/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class BatchDataLoader():
def __init__(self,
json_file: str,
train_mode: bool,
sortagrad: bool=False,
sortagrad: int=0,
batch_size: int=0,
maxlen_in: float=float('inf'),
maxlen_out: float=float('inf'),
Expand Down

0 comments on commit 95d5274

Please sign in to comment.