Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.
Python asraudiochineseemotion-recognitionfunasrmcp-servermultilingual-asropenai-compatible-apiparaformerpunctuationpytorchreal-time-asrspeaker-diarizationspeech-recognitionspeech-to-textstreaming-asrtranscriptionvllmvoice-activity-detectionwhisper-alternative
benchmark
游雁745ac1b175ba
diff --git a/funasr/runtime/python/benchmark_onnx.md b/funasr/runtime/python/benchmark_onnx.mdindex 5f6dcab6a..02adc7992 100644--- a/funasr/runtime/python/benchmark_onnx.md+++ b/funasr/runtime/python/benchmark_onnx.md@@ -1,6 +1,8 @@-Benchmark [Paraformer-large](https://www.modelscope.cn/models/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/summary) based on Aishell1 test set , the total audio duration is 36108.919 seconds.+# Benchmark-(Note: The service has been fully warm up.)+Aishell1 test set , the total audio duration is 36108.919 seconds. (Note: The service has been fully warm up.)++## [Paraformer-large](https://www.modelscope.cn/models/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/summary)### Intel(R) Xeon(R) Platinum 8369B CPU @ 2.90GHz 16core-32processor with avx512_vnni@@ -46,4 +48,6 @@ Benchmark [Paraformer-large](https://www.modelscope.cn/models/damo/speech_parafo| 64 (onnx fp32) | 153 | 0.0042 | 235.9 || 64 (onnx int8) | 103 | 0.0029 | 349.9 || 96 (onnx fp32) | 146 | 0.0041 | 247.0 |-| 96 (onnx int8) | 108 | 0.0030 | 334.1 |\ No newline at end of file+| 96 (onnx int8) | 108 | 0.0030 | 334.1 |++## [Paraformer](https://modelscope.cn/models/damo/speech_paraformer_asr_nat-zh-cn-16k-common-vocab8358-tensorflow1/summary)diff --git a/funasr/runtime/python/utils/test_rtf.py b/funasr/runtime/python/utils/test_rtf.pyindex 3394e8a04..46f204dae 100644--- a/funasr/runtime/python/utils/test_rtf.py+++ b/funasr/runtime/python/utils/test_rtf.py@@ -2,17 +2,24 @@import timeimport sysimport librosa-backend=sys.argv[1]-model_dir=sys.argv[2]-wav_file=sys.argv[3]+++import argparse+parser = argparse.ArgumentParser()+parser.add_argument('--model_dir', type=str, required=True)+parser.add_argument('--backend', type=str, default='onnx', help='["onnx", "torch"]')+parser.add_argument('--wav_file', type=int, default=0, help='amp fallback number')+parser.add_argument('--quantize', type=bool, default=False, help='quantized model')+args = parser.parse_args()+from torch_paraformer import Paraformer-if backend == "onnxruntime":+if args.backend == "onnxruntime":from rapid_paraformer import Paraformer-model = Paraformer(model_dir, batch_size=1, device_id="-1")+model = Paraformer(args.model_dir, batch_size=1, quantize=args.quantize)-wav_file_f = open(wav_file, 'r')+wav_file_f = open(args.wav_file, 'r')wav_files = wav_file_f.readlines()# warm-updiff --git a/funasr/runtime/python/utils/test_rtf.sh b/funasr/runtime/python/utils/test_rtf.shindex fe13da7d8..cada080f6 100644--- a/funasr/runtime/python/utils/test_rtf.sh+++ b/funasr/runtime/python/utils/test_rtf.sh@@ -5,28 +5,31 @@ nj=64backend=libtorchmodel_dir="/nfs/zhifu.gzf/export/damo/amp_int8/libtorch"tag=${backend}_fp32+quantize='False'!:<<!backend=libtorchmodel_dir="/nfs/zhifu.gzf/export/damo/amp_int8/libtorch_fb20"tag=${backend}_amp_fb20+quantize='True'!:<<!backend=onnxruntimemodel_dir="/nfs/zhifu.gzf/export/damo/amp_int8/onnx"tag=${backend}_fp32+quantize='False'!:<<!backend=onnxruntimemodel_dir="/nfs/zhifu.gzf/export/damo/amp_int8/onnx_dynamic"tag=${backend}_fp32+quantize='True'!-#scp=/nfs/haoneng.lhn/funasr_data/aishell-1/data/test/wav.scp-scp="/nfs/zhifu.gzf/data_debug/test/wav_1500.scp"+scp=/nfs/haoneng.lhn/funasr_data/aishell-1/data/test/wav.scplocal_scp_dir=/nfs/zhifu.gzf/data_debug/test/${tag}/split$njrtf_tool=test_rtf.py@@ -45,7 +48,7 @@ perl ../../../egs/aishell/transformer/utils/split_scp.pl $scp ${split_scps}for JOB in $(seq ${nj}); do{core_id=`expr $JOB - 1`- taskset -c ${core_id} python ${rtf_tool} ${backend} ${model_dir} ${local_scp_dir}/wav.$JOB.scp &> ${local_scp_dir}/log.$JOB.txt+ taskset -c ${core_id} python ${rtf_tool} --backend ${backend} --model_dir ${model_dir} --wav_file ${local_scp_dir}/wav.$JOB.scp --quantize ${quantize} &> ${local_scp_dir}/log.$JOB.txt}&done