| | |
| | | ## paraformer grpc onnx server in c++ |
| | | |
| | | |
| | | #### Step 1. Build ../onnxruntime as it's document |
| | | ``` |
| | | #put onnx-lib & onnx-asr-model & vocab.txt into /path/to/asrmodel(eg: /data/asrmodel) |
| | | #put onnx-lib & onnx-asr-model into /path/to/asrmodel(eg: /data/asrmodel) |
| | | ls /data/asrmodel/ |
| | | onnxruntime-linux-x64-1.14.0 speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch |
| | | |
| | | file /data/asrmodel/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/vocab.txt |
| | | UTF-8 Unicode text |
| | | #make sure you have config.yaml, am.mvn, model.onnx(or model_quant.onnx) under speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch |
| | | |
| | | ``` |
| | | |
| | | #### Step 2. Compile and install grpc v1.52.0 in case of grpc bugs |
| | |
| | | ./cmake/build/paraformer_server 10108 4 /data/asrmodel/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch false |
| | | ``` |
| | | |
| | | |
| | | |
| | | #### Step 5. Start grpc python paraformer client on PC with MIC |
| | | ``` |
| | | cd ../python/grpc |
| | | python grpc_main_client_mic.py --host $server_ip --port 10108 |
| | | ``` |
| | | |
| | | The `grpc_main_client_mic.py` follows the [original design] (https://github.com/alibaba-damo-academy/FunASR/tree/main/funasr/runtime/python/grpc#workflow-in-desgin) by sending audio_data with chunks. If you want to send audio_data in one request, here is an example: |
| | | |
| | | ``` |
| | |
| | | asyncio.run(test()) |
| | | |
| | | ``` |
| | | |
| | | |
| | | ## Acknowledge |
| | | 1. This project is maintained by [FunASR community](https://github.com/alibaba-damo-academy/FunASR). |
| | | 2. We acknowledge [DeepScience](https://www.deepscience.cn) for contributing the grpc service. |