Skip to content

Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.

fix paraformer finetune bug

北念d90de51e7609
diff --git a/funasr/bin/build_trainer.py b/funasr/bin/build_trainer.py
index 61af7663d..bda83ec87 100644
--- a/funasr/bin/build_trainer.py
+++ b/funasr/bin/build_trainer.py
@@ -548,7 +548,10 @@ def build_trainer(modelscope_dict,
init_param = modelscope_dict['init_model']
cmvn_file = modelscope_dict['cmvn_file']
seg_dict_file = modelscope_dict['seg_dict']
- bpemodel = modelscope_dict['bpemodel']
+ if 'bpemodel' in modelscope_dict:
+ bpemodel = modelscope_dict['bpemodel']
+ else:
+ bpemodel = None
# overwrite parameters
with open(config) as f:
@@ -582,7 +585,7 @@ def build_trainer(modelscope_dict,
args.seg_dict_file = seg_dict_file
else:
args.seg_dict_file = None
- if os.path.exists(bpemodel):
+ if bpemodel is not None and os.path.exists(bpemodel):
args.bpemodel = bpemodel
else:
args.bpemodel = None