From 4aebd0a465b8e1c755148d28ebe8ef2dc1c7215d Mon Sep 17 00:00:00 2001 From: sunjichen Date: Tue, 10 Feb 2026 10:39:29 +0800 Subject: [PATCH] Fix underscore in conformer models --- fastapi_funasr.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fastapi_funasr.py b/fastapi_funasr.py index 4a15382..1f5273b 100644 --- a/fastapi_funasr.py +++ b/fastapi_funasr.py @@ -203,12 +203,14 @@ def test_funasr(audio_file, lang): # paraformer模型会一个字一个字输出,中间夹太多空格会影响1-cer的结果 if lang == "zh": text = text.replace(" ", "") + text = text.replace("_", " ") elif model_type == "conformer": res = model.generate( input=segment_path, batch_size_s=300 ) text = res[0]["text"] + text = text.replace("_", " ") # elif model_type == "uni_asr": # if i == 0: # os.remove(segment_path)