From d80ac2fd2df4e7fb8a28acfa512bb11472b5cc99 Mon Sep 17 00:00:00 2001
From: liugz18 <57401541+liugz18@users.noreply.github.com>
Date: 星期四, 18 七月 2024 21:34:55 +0800
Subject: [PATCH] Rename 'res' in line 514 to avoid with naming conflict with line 365

---
 examples/industrial_data_pretraining/llm_asr/demo_speech2text.sh |   33 ++++++++++++++++-----------------
 1 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/examples/industrial_data_pretraining/llm_asr/demo_speech2text.sh b/examples/industrial_data_pretraining/llm_asr/demo_speech2text.sh
index d4c409b..3eba6d3 100644
--- a/examples/industrial_data_pretraining/llm_asr/demo_speech2text.sh
+++ b/examples/industrial_data_pretraining/llm_asr/demo_speech2text.sh
@@ -12,6 +12,7 @@
 out_dir="${ckpt_dir}/inference-${ckpt_id}"
 mkdir -p ${out_dir}
 for data_set in "librispeech_test_clean_speech2text.jsonl" "librispeech_test_other_speech2text.jsonl"; do
+{
     jsonl=${jsonl_dir}/${data_set}
     output_dir=${out_dir}/${data_set}
     mkdir -p ${output_dir}
@@ -22,10 +23,12 @@
 
     python /mnt/workspace/zhifu.gzf/codebase/FunASR/funasr/metrics/wer.py ++ref_file=${ref_file} ++hyp_file=${pred_file} ++cer_file=${pred_file}.cer ++cn_postprocess=false
 
+}&
 done
+wait
 
-
-for data_set in "aishell1_test_speech2text.jsonl" "aishell2_ios_test_speech2text.jsonl" "librispeech_test_other_speech2text.jsonl"; do
+for data_set in "aishell1_test_speech2text.jsonl" "aishell2_ios_test_speech2text.jsonl"; do
+{
     jsonl=${jsonl_dir}/${data_set}
     output_dir=${out_dir}/${data_set}
     mkdir -p ${output_dir}
@@ -36,9 +39,12 @@
 
     python /mnt/workspace/zhifu.gzf/codebase/FunASR/funasr/metrics/wer.py ++ref_file=${ref_file} ++hyp_file=${pred_file} ++cer_file=${pred_file}.cer ++cn_postprocess=true
 
+}&
 done
+wait
 
-for data_set in "s2tt_en2zh.v20240605.test.jsonl"; do
+for data_set in "common_voice_zh-CN_speech2text.jsonl" "common_voice_en_speech2text.jsonl"; do
+{
     jsonl=${jsonl_dir}/${data_set}
     output_dir=${out_dir}/${data_set}
     mkdir -p ${output_dir}
@@ -47,19 +53,12 @@
 
     python ./demo_speech2text.py ${ckpt_dir} ${ckpt_id} ${jsonl} ${output_dir} ${device}
 
-    python /mnt/workspace/zhifu.gzf/codebase/FunASR/funasr/metrics/wer.py ++ref_file=${ref_file} ++hyp_file=${pred_file} ++cer_file=${pred_file}.cer ++cn_postprocess=true
+    cn_postprocess=false
+    if [ $data_set = "common_voice_zh-CN_speech2text.jsonl" ];then
+      cn_postprocess=true
+    fi
 
+    python /mnt/workspace/zhifu.gzf/codebase/FunASR/funasr/metrics/wer.py ++ref_file=${ref_file} ++hyp_file=${pred_file} ++cer_file=${pred_file}.cer ++cn_postprocess=${cn_postprocess}
+
+}&
 done
-
-for data_set in "s2tt_zh2en.v20240605.test.jsonl"; do
-    jsonl=${jsonl_dir}/${data_set}
-    output_dir=${out_dir}/${data_set}
-    mkdir -p ${output_dir}
-    pred_file=${output_dir}/1best_recog/text_tn
-    ref_file=${output_dir}/1best_recog/label
-
-    python ./demo_speech2text.py ${ckpt_dir} ${ckpt_id} ${jsonl} ${output_dir} ${device}
-
-    python /mnt/workspace/zhifu.gzf/codebase/FunASR/funasr/metrics/wer.py ++ref_file=${ref_file} ++hyp_file=${pred_file} ++cer_file=${pred_file}.cer ++cn_postprocess=false
-
-done
\ No newline at end of file

--
Gitblit v1.9.1