Skip to content

Commit 15706a8

Browse files
authored
Merge pull request #1449 from Jackwaterveg/fix
[ASR] fix sortagrad
2 parents 4635bb6 + 95d5274 commit 15706a8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

paddlespeech/s2t/io/batchfy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def make_batchset(
419419
# sort it by input lengths (long to short)
420420
sorted_data = sorted(
421421
d.items(),
422-
key=lambda data: int(data[1][batch_sort_key][batch_sort_axis]["shape"][0]),
422+
key=lambda data: float(data[1][batch_sort_key][batch_sort_axis]["shape"][0]),
423423
reverse=not shortest_first, )
424424
logger.info("# utts: " + str(len(sorted_data)))
425425

paddlespeech/s2t/io/dataloader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class BatchDataLoader():
6161
def __init__(self,
6262
json_file: str,
6363
train_mode: bool,
64-
sortagrad: bool=False,
64+
sortagrad: int=0,
6565
batch_size: int=0,
6666
maxlen_in: float=float('inf'),
6767
maxlen_out: float=float('inf'),

0 commit comments

Comments
 (0)