| | |
| | | # Using funasr with grpc-cpp |
| | | # Service with grpc-cpp |
| | | |
| | | ## For the Server |
| | | |
| | | ### Build [onnxruntime](./onnxruntime_cpp.md) as it's document |
| | | |
| | | ``` |
| | | #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 |
| | | |
| | | #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 |
| | | |
| | | ``` |
| | | |
| | | ### Compile and install grpc v1.52.0 in case of grpc bugs |
| | | ``` |
| | |
| | | |
| | | ### Start grpc paraformer server |
| | | ``` |
| | | Usage: ./cmake/build/paraformer_server port thread_num /path/to/model_file quantize(true or false) |
| | | ./cmake/build/paraformer_server 10108 4 /data/asrmodel/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch false |
| | | |
| | | ./cmake/build/paraformer-server --port-id <string> [--punc-quant <string>] |
| | | [--punc-dir <string>] [--vad-quant <string>] |
| | | [--vad-dir <string>] [--quantize <string>] |
| | | --model-dir <string> [--] [--version] [-h] |
| | | Where: |
| | | --port-id <string> |
| | | (required) port id |
| | | --model-dir <string> |
| | | (required) the asr model path, which contains model.onnx, config.yaml, am.mvn |
| | | --quantize <string> |
| | | false (Default), load the model of model.onnx in model_dir. If set true, load the model of model_quant.onnx in model_dir |
| | | |
| | | --vad-dir <string> |
| | | the vad model path, which contains model.onnx, vad.yaml, vad.mvn |
| | | --vad-quant <string> |
| | | false (Default), load the model of model.onnx in vad_dir. If set true, load the model of model_quant.onnx in vad_dir |
| | | |
| | | --punc-dir <string> |
| | | the punc model path, which contains model.onnx, punc.yaml |
| | | --punc-quant <string> |
| | | false (Default), load the model of model.onnx in punc_dir. If set true, load the model of model_quant.onnx in punc_dir |
| | | |
| | | Required: --port-id <string> --model-dir <string> |
| | | If use vad, please add: --vad-dir <string> |
| | | If use punc, please add: --punc-dir <string> |
| | | ``` |
| | | |
| | | ## For the client |