| | |
| | | ``` |
| | | 更多详细用法([示例](https://github.com/alibaba-damo-academy/FunASR/tree/main/examples/industrial_data_pretraining)) |
| | | |
| | | ## 导出ONNX |
| | | ### 从命令行导出 |
| | | ```shell |
| | | funasr-export ++model=paraformer ++quantize=false |
| | | ``` |
| | | |
| | | ### 从Python导出 |
| | | ```python |
| | | from funasr import AutoModel |
| | | |
| | | model = AutoModel(model="paraformer") |
| | | |
| | | res = model.export(quantize=False) |
| | | ``` |
| | | |
| | | ### 测试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) |
| | | ``` |
| | | |
| | | 更多例子请参考 [样例](runtime/python/onnxruntime) |
| | | |
| | | <a name="服务部署"></a> |
| | | ## 服务部署 |