Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.
Python asraudiochineseemotion-recognitionfunasrmcp-servermultilingual-asropenai-compatible-apiparaformerpunctuationpytorchreal-time-asrspeaker-diarizationspeech-recognitionspeech-to-textstreaming-asrtranscriptionvllmvoice-activity-detectionwhisper-alternative
update demo.py
shixian.shiec52bc3aff84
diff --git a/funasr/runtime/python/libtorch/demo.py b/funasr/runtime/python/libtorch/demo.pyindex 251d36d3c..b81aca6d0 100644--- a/funasr/runtime/python/libtorch/demo.py+++ b/funasr/runtime/python/libtorch/demo.py@@ -2,7 +2,7 @@ from funasr_torch import Paraformer#model_dir = "/Users/shixian/code/funasr/export/damo/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch"model_dir = "/Users/shixian/code/funasr/export/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch"-model = Paraformer(model_dir, batch_size=2, pred_bias=1)+model = Paraformer(model_dir, batch_size=2)# when using paraformer-tiny-commandword_asr_nat-zh-cn-16k-vocab544-pytorch, you should set pred_bias=0# plot_timestamp_to works only when using speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch@@ -11,8 +11,8 @@ model = Paraformer(model_dir, batch_size=2, pred_bias=1)# when using paraformer-large-vad-punc model, you can set plot_timestamp_to="./xx.png" to get figure of alignment besides timestamps# model_dir = "/Users/shixian/code/funasr/export/damo/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch"-# model = Paraformer(model_dir, batch_size=1, pred_bias=1)-# model = Paraformer(model_dir, batch_size=1, plot_timestamp_to="test.png", pred_bias=1)+# model = Paraformer(model_dir, batch_size=1)+# model = Paraformer(model_dir, batch_size=1, plot_timestamp_to="test.png")wav_path = "YourPath/xx.wav"diff --git a/funasr/runtime/python/onnxruntime/demo.py b/funasr/runtime/python/onnxruntime/demo.pyindex a9111c156..351b7028c 100644--- a/funasr/runtime/python/onnxruntime/demo.py+++ b/funasr/runtime/python/onnxruntime/demo.py@@ -2,7 +2,7 @@ from funasr_onnx import Paraformer#model_dir = "/Users/shixian/code/funasr/export/damo/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch"model_dir = "/Users/shixian/code/funasr/export/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch"-model = Paraformer(model_dir, batch_size=2, pred_bias=1)+model = Paraformer(model_dir, batch_size=2)# when using paraformer-tiny-commandword_asr_nat-zh-cn-16k-vocab544-pytorch, you should set pred_bias=0# plot_timestamp_to works only when using speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch@@ -11,8 +11,8 @@ model = Paraformer(model_dir, batch_size=2, pred_bias=1)# when using paraformer-large-vad-punc model, you can set plot_timestamp_to="./xx.png" to get figure of alignment besides timestamps# model_dir = "/Users/shixian/code/funasr/export/damo/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch"-# model = Paraformer(model_dir, batch_size=1, pred_bias=1)-# model = Paraformer(model_dir, batch_size=1, plot_timestamp_to="test.png", pred_bias=1)+# model = Paraformer(model_dir, batch_size=1)+# model = Paraformer(model_dir, batch_size=1, plot_timestamp_to="test.png")wav_path = "YourPath/xx.wav"