Skip to content

Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.

rtf benchmark

游雁50571828c62e
diff --git a/funasr/export/README.md b/funasr/export/README.md
index b3068d050..c05348e82 100644
--- a/funasr/export/README.md
+++ b/funasr/export/README.md
@@ -17,7 +17,7 @@ The installation is the same as [funasr](../../README.md)
--model-name [model_name] \
--export-dir [export_dir] \
--type [onnx, torch] \
- --quantize \
+ --quantize [true, false] \
--fallback-num [fallback_num]
```
`model-name`: the model is to export. It could be the models from modelscope, or local finetuned model(named: model.pb).
diff --git a/funasr/export/export_model.py b/funasr/export/export_model.py
index 9a1ef9604..f6ba61616 100644
--- a/funasr/export/export_model.py
+++ b/funasr/export/export_model.py
@@ -10,7 +10,7 @@ import torch
from funasr.export.models import get_model
import numpy as np
import random
-
+from funasr.utils.types import str2bool
# torch_version = float(".".join(torch.__version__.split(".")[:2]))
# assert torch_version > 1.9
@@ -234,7 +234,7 @@ if __name__ == '__main__':
parser.add_argument('--model-name', type=str, required=True)
parser.add_argument('--export-dir', type=str, required=True)
parser.add_argument('--type', type=str, default='onnx', help='["onnx", "torch"]')
- parser.add_argument('--quantize', action='store_true', help='export quantized model')
+ parser.add_argument('--quantize', type=str2bool, default=False, help='export quantized model')
parser.add_argument('--fallback-num', type=int, default=0, help='amp fallback number')
parser.add_argument('--audio_in', type=str, default=None, help='["wav", "wav.scp"]')
parser.add_argument('--calib_num', type=int, default=200, help='calib max num')
diff --git a/funasr/runtime/python/utils/test_rtf.py b/funasr/runtime/python/utils/test_rtf.py
index fd26fad94..536ee2d87 100644
--- a/funasr/runtime/python/utils/test_rtf.py
+++ b/funasr/runtime/python/utils/test_rtf.py
@@ -2,14 +2,14 @@
import time
import sys
import librosa
-
+from funasr.utils.types import str2bool
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=str, default=None, help='amp fallback number')
-parser.add_argument('--quantize', type=bool, default=False, help='quantized model')
+parser.add_argument('--quantize', type=str2bool, default=False, help='quantized model')
parser.add_argument('--intra_op_num_threads', type=int, default=1, help='intra_op_num_threads for onnx')
args = parser.parse_args()
diff --git a/funasr/runtime/python/utils/test_rtf.sh b/funasr/runtime/python/utils/test_rtf.sh
index 8ac2143ed..5fa664517 100644
--- a/funasr/runtime/python/utils/test_rtf.sh
+++ b/funasr/runtime/python/utils/test_rtf.sh
@@ -10,7 +10,7 @@ rtf_tool=test_rtf.py
#:<<!
model_name="damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch"
backend="onnx" # "torch"
-quantize='True' # 'False'
+quantize='true' # 'False'
tag=${model_name}/${backend}_${quantize}
!
@@ -21,11 +21,7 @@ echo ${logs_outputs_dir}
if [ $stage == 0 ];then
- if [ $quantize == 'True' ];then
python -m funasr.export.export_model --model-name ${model_name} --export-dir ${export_root} --type ${backend} --quantize --audio_in ${scp}
- else
- python -m funasr.export.export_model --model-name ${model_name} --export-dir ${export_root} --type ${backend}
- fi
fi
diff --git a/push_scan.py b/push_scan.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/scan.py b/scan.py
new file mode 100644
index 000000000..e69de29bb