diff --git a/examples/aishell/s1/local/test.sh b/examples/aishell/s1/local/test.sh index 1886590f..f7e99ad7 100755 --- a/examples/aishell/s1/local/test.sh +++ b/examples/aishell/s1/local/test.sh @@ -17,7 +17,7 @@ config_path=$1 ckpt_prefix=$2 chunk_mode=false -if [[ ${config_path} =~ ^chunk_ ]];then +if [[ ${config_path} =~ ^.*chunk_.*yaml$ ]];then chunk_mode=true fi diff --git a/examples/dataset/aidatatang_200zh/aidatatang_200zh.py b/examples/dataset/aidatatang_200zh/aidatatang_200zh.py index cc77c3c4..e32f619e 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 e95327cc..66e06901 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 d34c3223..88852132 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 44a6d367..0915e5b3 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 d03e3a22..77a264cb 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 222d9af3..311d445c 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) diff --git a/examples/librispeech/s1/local/test.sh b/examples/librispeech/s1/local/test.sh index fe01d700..3bd3f0bb 100755 --- a/examples/librispeech/s1/local/test.sh +++ b/examples/librispeech/s1/local/test.sh @@ -17,9 +17,10 @@ config_path=$1 ckpt_prefix=$2 chunk_mode=false -if [[ ${config_path} =~ ^chunk_ ]];then +if [[ ${config_path} =~ ^.*chunk_.*yaml$ ]];then chunk_mode=true fi +echo "chunk mode ${chunk_mode}" # download language model diff --git a/examples/timit/s1/local/test.sh b/examples/timit/s1/local/test.sh index fe01d700..a137924e 100755 --- a/examples/timit/s1/local/test.sh +++ b/examples/timit/s1/local/test.sh @@ -17,7 +17,7 @@ config_path=$1 ckpt_prefix=$2 chunk_mode=false -if [[ ${config_path} =~ ^chunk_ ]];then +if [[ ${config_path} =~ ^.*chunk_.*yaml$ ]];then chunk_mode=true fi diff --git a/examples/tiny/s1/local/test.sh b/examples/tiny/s1/local/test.sh index eb5e995d..4d3ed081 100755 --- a/examples/tiny/s1/local/test.sh +++ b/examples/tiny/s1/local/test.sh @@ -16,7 +16,7 @@ config_path=$1 ckpt_prefix=$2 chunk_mode=false -if [[ ${config_path} =~ ^chunk_ ]];then +if [[ ${config_path} =~ ^.*chunk_.*yaml$ ]];then chunk_mode=true fi