From 3aa5104dd076be79f1498724efe510d1cae6f269 Mon Sep 17 00:00:00 2001 From: jinzr <60612200+JinZr@users.noreply.github.com> Date: Thu, 7 Sep 2023 15:12:38 +0800 Subject: [PATCH] minor updates --- egs/multi_zh-hans/ASR/local/prepare_for_bpe_model.py | 6 +++--- egs/multi_zh-hans/ASR/prepare.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/egs/multi_zh-hans/ASR/local/prepare_for_bpe_model.py b/egs/multi_zh-hans/ASR/local/prepare_for_bpe_model.py index 328bb4809..020800c15 100755 --- a/egs/multi_zh-hans/ASR/local/prepare_for_bpe_model.py +++ b/egs/multi_zh-hans/ASR/local/prepare_for_bpe_model.py @@ -56,9 +56,9 @@ def main(): transcript_path = lang_dir / "transcript_chars.txt" with open(text, "r", encoding="utf-8") as fin: - text_lines = fin.readlines() - with open(transcript_path, "w+", encoding="utf-8") as fout: - fout.writelines([f"{tokenize_by_CJK_char(line)}\n" for line in text_lines]) + with open(transcript_path, "w+", encoding="utf-8") as fout: + for line in fin: + fout.write(tokenize_by_CJK_char(line) + "\n") if __name__ == "__main__": diff --git a/egs/multi_zh-hans/ASR/prepare.sh b/egs/multi_zh-hans/ASR/prepare.sh index 7d54ad362..5d0fe66a4 100755 --- a/egs/multi_zh-hans/ASR/prepare.sh +++ b/egs/multi_zh-hans/ASR/prepare.sh @@ -353,7 +353,7 @@ if [ $stage -le 14 ] && [ $stop_stage -ge 14 ]; then if [ -d ../../wenetspeech/ASR/data/lang_char/ ]; then cd data - cp -r ../../../../wenetspeech/ASR/data/lm . + ln -s ../../../../wenetspeech/ASR/data/lm . cd .. else log "Abort! Please run ../../wenetspeech/ASR/prepare.sh"