diff --git a/examples/dataset/aidatatang_200zh/aidatatang_200zh.py b/examples/dataset/aidatatang_200zh/aidatatang_200zh.py index cc77c3c48de2a40afcfcdf3b822331506c762dda..e32f619e90eaded75aa465fa8bc2ae39b6e77486 100644 --- a/examples/dataset/aidatatang_200zh/aidatatang_200zh.py +++ b/examples/dataset/aidatatang_200zh/aidatatang_200zh.py @@ -102,7 +102,9 @@ def create_manifest(data_dir, manifest_path_prefix): for line in json_lines: fout.write(line + '\n') - with open(dtype + '.meta', 'w') as f: + manifest_dir = os.path.dirname(manifest_path_prefix) + meta_path = os.path.join(manifest_dir, dtype) + '.meta' + with open(meta_path, 'w') as f: print(f"{dtype}:", file=f) print(f"{total_num} utts", file=f) print(f"{total_sec / (60*60)} h", file=f) diff --git a/examples/dataset/aishell/aishell.py b/examples/dataset/aishell/aishell.py index e95327cc8099d27775c94c9812c7150408746786..66e0690138a91d3fd465547a71fcde6d1922b3ef 100644 --- a/examples/dataset/aishell/aishell.py +++ b/examples/dataset/aishell/aishell.py @@ -103,7 +103,9 @@ def create_manifest(data_dir, manifest_path_prefix): for line in json_lines: fout.write(line + '\n') - with open(dtype + '.meta', 'w') as f: + manifest_dir = os.path.dirname(manifest_path_prefix) + meta_path = os.path.join(manifest_dir, dtype) + '.meta' + with open(meta_path, 'w') as f: print(f"{dtype}:", file=f) print(f"{total_num} utts", file=f) print(f"{total_sec / (60*60)} h", file=f) diff --git a/examples/dataset/librispeech/librispeech.py b/examples/dataset/librispeech/librispeech.py index d34c3223e4c25ac7bcfdafbc1e2f9455115bc7dc..8885213250d7d2fff686b12bd593d1ad95a0dd0f 100644 --- a/examples/dataset/librispeech/librispeech.py +++ b/examples/dataset/librispeech/librispeech.py @@ -114,8 +114,10 @@ def create_manifest(data_dir, manifest_path): for line in json_lines: out_file.write(line + '\n') - subset = manifest_path - with open(subset + '.meta', 'w') as f: + subset = os.path.splitext(manifest_path)[1][1:] + manifest_dir = os.path.dirname(manifest_path) + meta_path = os.path.join(manifest_dir, dtype) + '.meta' + with open(meta_path, 'w') as f: print(f"{subset}:", file=f) print(f"{total_num} utts", file=f) print(f"{total_sec / (60*60)} h", file=f) diff --git a/examples/dataset/mini_librispeech/mini_librispeech.py b/examples/dataset/mini_librispeech/mini_librispeech.py index 44a6d3671b4c30bc9933f3874e81b22a1baa4dee..0915e5b302ee44e828a37e10710a54e32d3933a0 100644 --- a/examples/dataset/mini_librispeech/mini_librispeech.py +++ b/examples/dataset/mini_librispeech/mini_librispeech.py @@ -93,8 +93,10 @@ def create_manifest(data_dir, manifest_path): for line in json_lines: out_file.write(line + '\n') - subset = os.path.splitext(manifest_path)[1] - with open(subset + '.meta', 'w') as f: + subset = os.path.splitext(manifest_path)[1][1:] + manifest_dir = os.path.dirname(manifest_path) + meta_path = os.path.join(manifest_dir, dtype) + '.meta' + with open(meta_path, 'w') as f: print(f"{subset}:", file=f) print(f"{total_num} utts", file=f) print(f"{total_sec / (60*60)} h", file=f) diff --git a/examples/dataset/thchs30/thchs30.py b/examples/dataset/thchs30/thchs30.py index d03e3a22ef0e4c8bfdbe99ed1c6192ee33a81dba..77a264cbba1171a027e6548a6176d5d9822515b5 100644 --- a/examples/dataset/thchs30/thchs30.py +++ b/examples/dataset/thchs30/thchs30.py @@ -139,7 +139,9 @@ def create_manifest(data_dir, manifest_path_prefix): for line in json_lines: fout.write(line + '\n') - with open(dtype + '.meta', 'w') as f: + manifest_dir = os.path.dirname(manifest_path_prefix) + meta_path = os.path.join(manifest_dir, dtype) + '.meta' + with open(meta_path, 'w') as f: print(f"{dtype}:", file=f) print(f"{total_num} utts", file=f) print(f"{total_sec / (60*60)} h", file=f) diff --git a/examples/dataset/timit/timit.py b/examples/dataset/timit/timit.py index 222d9af302a3887853d2c7d4088f6d1523b856a0..311d445cb3a1e5123889d50b5028ca1aeb85ca19 100644 --- a/examples/dataset/timit/timit.py +++ b/examples/dataset/timit/timit.py @@ -198,7 +198,9 @@ def create_manifest(data_dir, manifest_path_prefix): for line in json_lines: fout.write(line + '\n') - with open(dtype.lower() + '.meta', 'w') as f: + manifest_dir = os.path.dirname(manifest_path_prefix) + meta_path = os.path.join(manifest_dir, dtype.lower()) + '.meta' + with open(meta_path, 'w') as f: print(f"{dtype}:", file=f) print(f"{total_num} utts", file=f) print(f"{total_sec / (60*60)} h", file=f)