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
维石1c96d9aec2ae
diff --git a/runtime/python/libtorch/demo_contextual_paraformer.py b/runtime/python/libtorch/demo_contextual_paraformer.pynew file mode 100644index 000000000..9542d4dbd--- /dev/null+++ b/runtime/python/libtorch/demo_contextual_paraformer.py@@ -0,0 +1,12 @@+from pathlib import Path+from funasr_torch import Paraformer++model_dir = "damo/speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404"+model = Paraformer(model_dir, batch_size=1) # cpu+# model = Paraformer(model_dir, batch_size=1, device_id=0) # gpu++wav_path = "{}/.cache/modelscope/hub/{}/example/asr_example.wav".format(Path.home(), model_dir)+hotwords = "你的热词 魔搭"++result = model(wav_path, hotwords)+print(result)diff --git a/runtime/python/libtorch/demo.py b/runtime/python/libtorch/demo_paraformer.pysimilarity index 99%rename from runtime/python/libtorch/demo.pyrename to runtime/python/libtorch/demo_paraformer.pyindex dc4efe1d6..9c3a08238 100644--- a/runtime/python/libtorch/demo.py+++ b/runtime/python/libtorch/demo_paraformer.py@@ -2,7 +2,6 @@ from pathlib import Pathfrom funasr_torch import Paraformermodel_dir = "iic/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch"-model = Paraformer(model_dir, batch_size=1) # cpu# model = Paraformer(model_dir, batch_size=1, device_id=0) # gpu