From 9ba0dbd98bf69c830dfcfde8f109a400cb65e4e5 Mon Sep 17 00:00:00 2001 From: 雾聪 <wucong.lyb@alibaba-inc.com> Date: 星期五, 29 三月 2024 17:24:59 +0800 Subject: [PATCH] fix func Forward --- README.md | 21 ++++++++++++++++++--- 1 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9841fe1..38fd686 100644 --- a/README.md +++ b/README.md @@ -215,18 +215,33 @@ ### Command-line usage ```shell -funasr-export ++model=paraformer ++quantize=false +funasr-export ++model=paraformer ++quantize=false ++device=cpu ``` -### python +### Python ```python from funasr import AutoModel -model = AutoModel(model="paraformer") +model = AutoModel(model="paraformer", device="cpu") res = model.export(quantize=False) ``` +### Text ONNX +```python +# pip3 install -U funasr-onnx +from funasr_onnx import Paraformer +model_dir = "damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch" +model = Paraformer(model_dir, batch_size=1, quantize=True) + +wav_path = ['~/.cache/modelscope/hub/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/example/asr_example.wav'] + +result = model(wav_path) +print(result) +``` + +More examples ref to [demo](runtime/python/onnxruntime) + ## Deployment Service FunASR supports deploying pre-trained or further fine-tuned models for service. Currently, it supports the following types of service deployment: - File transcription service, Mandarin, CPU version, done -- Gitblit v1.9.1