Преглед изворни кода

fix infer_after_finetune.py

jmwang66 пре 3 година
родитељ
комит
65b35ca423

+ 1 - 1
egs_modelscope/asr/data2vec/speech_data2vec_pretrain-zh-cn-aishell2-16k-pytorch/infer_after_finetune.py

@@ -37,7 +37,7 @@ def modelscope_infer_after_finetune(params):
 
     # computer CER if GT text is set
     text_in = os.path.join(params["data_dir"], "text")
-    if text_in is not None:
+    if os.path.exists(text_in):
         text_proc_file = os.path.join(decoding_path, "1best_recog/token")
         compute_wer(text_in, text_proc_file, os.path.join(decoding_path, "text.cer"))
 

+ 1 - 1
egs_modelscope/asr/paraformer/speech_paraformer-large_asr_nat-zh-cn-16k-aishell1-vocab8404-pytorch/infer_after_finetune.py

@@ -38,7 +38,7 @@ def modelscope_infer_after_finetune(params):
 
     # computer CER if GT text is set
     text_in = os.path.join(params["data_dir"], "text")
-    if text_in is not None:
+    if os.path.exists(text_in):
         text_proc_file = os.path.join(decoding_path, "1best_recog/token")
         compute_wer(text_in, text_proc_file, os.path.join(decoding_path, "text.cer"))
 

+ 1 - 1
egs_modelscope/asr/paraformer/speech_paraformer-large_asr_nat-zh-cn-16k-aishell2-vocab8404-pytorch/infer_after_finetune.py

@@ -38,7 +38,7 @@ def modelscope_infer_after_finetune(params):
 
     # computer CER if GT text is set
     text_in = os.path.join(params["data_dir"], "text")
-    if text_in is not None:
+    if os.path.exists(text_in):
         text_proc_file = os.path.join(decoding_path, "1best_recog/token")
         compute_wer(text_in, text_proc_file, os.path.join(decoding_path, "text.cer"))
 

+ 1 - 1
egs_modelscope/asr/paraformer/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/infer_after_finetune.py

@@ -38,7 +38,7 @@ def modelscope_infer_after_finetune(params):
 
     # computer CER if GT text is set
     text_in = os.path.join(params["data_dir"], "text")
-    if text_in is not None:
+    if os.path.exists(text_in):
         text_proc_file = os.path.join(decoding_path, "1best_recog/token")
         compute_wer(text_in, text_proc_file, os.path.join(decoding_path, "text.cer"))
 

+ 1 - 1
egs_modelscope/asr/paraformer/speech_paraformer_asr_nat-zh-cn-8k-common-vocab8358-tensorflow1/infer_after_finetune.py

@@ -38,7 +38,7 @@ def modelscope_infer_after_finetune(params):
 
     # computer CER if GT text is set
     text_in = os.path.join(params["data_dir"], "text")
-    if text_in is not None:
+    if os.path.exists(text_in):
         text_proc_file = os.path.join(decoding_path, "1best_recog/token")
         compute_wer(text_in, text_proc_file, os.path.join(decoding_path, "text.cer"))