Skip to content

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

update scripts

shixian.shif1d86e9dd54b
diff --git a/examples/industrial_data_pretraining/paraformer-long/demo.py b/examples/industrial_data_pretraining/paraformer-long/demo.py
index e45cae871..ca61ee328 100644
--- a/examples/industrial_data_pretraining/paraformer-long/demo.py
+++ b/examples/industrial_data_pretraining/paraformer-long/demo.py
@@ -5,10 +5,10 @@
from funasr import AutoModel
-model = AutoModel(model="/Users/zhifu/Downloads/modelscope_models/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch",
- vad_model="/Users/zhifu/Downloads/modelscope_models/speech_fsmn_vad_zh-cn-16k-common-pytorch",
- punc_model="/Users/zhifu/Downloads/modelscope_models/punc_ct-transformer_zh-cn-common-vocab272727-pytorch",
+model = AutoModel(model="../modelscope_models/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch",
+ vad_model="../modelscope_models/speech_fsmn_vad_zh-cn-16k-common-pytorch",
+ punc_model="../modelscope_models/punc_ct-transformer_zh-cn-common-vocab272727-pytorch",
)
-res = model(input="/Users/zhifu/Downloads/modelscope_models/speech_fsmn_vad_zh-cn-16k-common-pytorch/example/vad_example.wav", batch_size_s=300, batch_size_threshold_s=60)
+res = model(input="../modelscope_models/speech_fsmn_vad_zh-cn-16k-common-pytorch/example/asr_example.wav", batch_size_s=300, batch_size_threshold_s=60)
print(res)
\ No newline at end of file
diff --git a/examples/industrial_data_pretraining/paraformer-long/infer.sh b/examples/industrial_data_pretraining/paraformer-long/infer.sh
index fc2a09aa3..8f6ea138c 100644
--- a/examples/industrial_data_pretraining/paraformer-long/infer.sh
+++ b/examples/industrial_data_pretraining/paraformer-long/infer.sh
@@ -1,22 +1,22 @@
# download model
-local_path_root=./modelscope_models
+local_path_root=../modelscope_models
mkdir -p ${local_path_root}
local_path=${local_path_root}/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch
git clone https://www.modelscope.cn/damo/speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404.git ${local_path}
local_path_vad=${local_path_root}/speech_fsmn_vad_zh-cn-16k-common-pytorch
-git clone https://www.modelscope.cn/damo/speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404.git ${local_path_vad}
+git clone https://www.modelscope.cn/damo/speech_fsmn_vad_zh-cn-16k-common-pytorch.git ${local_path_vad}
local_path_punc=${local_path_root}/punc_ct-transformer_zh-cn-common-vocab272727-pytorch
-git clone https://www.modelscope.cn/damo/speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404.git ${local_path_punc}
+git clone https://www.modelscope.cn/damo/punc_ct-transformer_zh-cn-common-vocab272727-pytorch.git ${local_path_punc}
python funasr/bin/inference.py \
+model="${local_path}" \
-+vad_model="${local_path_vad}"
-+punc_model="${local_path_punc}"
++vad_model="${local_path_vad}" \
++punc_model="${local_path_punc}" \
+input="${local_path}/example/asr_example.wav" \
+output_dir="./outputs/debug" \
+device="cpu" \
diff --git a/examples/industrial_data_pretraining/seaco_paraformer/demo.py b/examples/industrial_data_pretraining/seaco_paraformer/demo.py
index 2e6d2034d..039d3f3ac 100644
--- a/examples/industrial_data_pretraining/seaco_paraformer/demo.py
+++ b/examples/industrial_data_pretraining/seaco_paraformer/demo.py
@@ -5,8 +5,12 @@
from funasr import AutoModel
-model = AutoModel(model="../modelscope_models/speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404")
+model = AutoModel(model="../modelscope_models/speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404",
+ )
+
+#vad_model="../modelscope_models/speech_fsmn_vad_zh-cn-16k-common-pytorch",
+#punc_model="../modelscope_models/punc_ct-transformer_zh-cn-common-vocab272727-pytorch"
res = model(input="../modelscope_models/speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404/example/asr_example.wav",
- hotword='达摩院 魔搭')
+ hotword='达摩院 磨搭')
print(res)
\ No newline at end of file
diff --git a/examples/industrial_data_pretraining/seaco_paraformer/infer.sh b/examples/industrial_data_pretraining/seaco_paraformer/infer.sh
index a39083b36..121c61006 100644
--- a/examples/industrial_data_pretraining/seaco_paraformer/infer.sh
+++ b/examples/industrial_data_pretraining/seaco_paraformer/infer.sh
@@ -2,9 +2,15 @@
# download model
local_path_root=../modelscope_models
mkdir -p ${local_path_root}
+
local_path=${local_path_root}/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch
git clone https://www.modelscope.cn/damo/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch.git ${local_path}
+#local_path_vad=${local_path_root}/speech_fsmn_vad_zh-cn-16k-common-pytorch
+#git clone https://www.modelscope.cn/damo/speech_fsmn_vad_zh-cn-16k-common-pytorch.git ${local_path_vad}
+
+#local_path_punc=${local_path_root}/punc_ct-transformer_zh-cn-common-vocab272727-pytorch
+#git clone https://www.modelscope.cn/damo/punc_ct-transformer_zh-cn-common-vocab272727-pytorch.git ${local_path_punc}
python funasr/bin/inference.py \
+model="${local_path}" \
@@ -13,3 +19,5 @@ python funasr/bin/inference.py \
+device="cpu" \
+"hotword='达摩院 魔搭'"
+#+vad_model="${local_path_vad}" \
+#+punc_model="${local_path_punc}" \
\ No newline at end of file