From 8e740e9897834c77e2475790741b330c18e518dc Mon Sep 17 00:00:00 2001 From: season <season4675@gmail.com> Date: 星期日, 02 七月 2023 19:38:48 +0800 Subject: [PATCH] [funasr-runtime-deploy 0.0.4] streamline the process, and add command line parameters. (#697) --- funasr/runtime/python/libtorch/demo.py | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/funasr/runtime/python/libtorch/demo.py b/funasr/runtime/python/libtorch/demo.py index b2b65ac..1a9d9e9 100644 --- a/funasr/runtime/python/libtorch/demo.py +++ b/funasr/runtime/python/libtorch/demo.py @@ -1,10 +1,15 @@ - from funasr_torch import Paraformer -model_dir = "/nfs/zhifu.gzf/export/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch" -model = Paraformer(model_dir, batch_size=1, device_id=0) -wav_path = ['/nfs/zhifu.gzf/export/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/example/asr_example.wav'] +model_dir = "/nfs/zhifu.gzf/export/damo/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 + +# when using paraformer-large-vad-punc model, you can set plot_timestamp_to="./xx.png" to get figure of alignment besides timestamps +# model = Paraformer(model_dir, batch_size=1, plot_timestamp_to="test.png") + +wav_path = "YourPath/xx.wav" result = model(wav_path) print(result) -- Gitblit v1.9.1