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
quant
游雁b8b764df0282
diff --git a/funasr/runtime/python/libtorch/torch_paraformer/paraformer_bin.py b/funasr/runtime/python/libtorch/torch_paraformer/paraformer_bin.pyindex 3545ccf48..ce975f0af 100644--- a/funasr/runtime/python/libtorch/torch_paraformer/paraformer_bin.py+++ b/funasr/runtime/python/libtorch/torch_paraformer/paraformer_bin.py@@ -24,12 +24,15 @@ class Paraformer():device_id: Union[str, int] = "-1",plot_timestamp_to: str = "",pred_bias: int = 1,+ quantize: bool = False,):if not Path(model_dir).exists():raise FileNotFoundError(f'{model_dir} does not exist.')model_file = os.path.join(model_dir, 'model.torchscripts')+ if quantize:+ model_file = os.path.join(model_dir, 'model_quant.torchscripts')config_file = os.path.join(model_dir, 'config.yaml')cmvn_file = os.path.join(model_dir, 'am.mvn')config = read_yaml(config_file)diff --git a/funasr/runtime/python/onnxruntime/rapid_paraformer/paraformer_onnx.py b/funasr/runtime/python/onnxruntime/rapid_paraformer/paraformer_onnx.pyindex 850f007c7..422cb6714 100644--- a/funasr/runtime/python/onnxruntime/rapid_paraformer/paraformer_onnx.py+++ b/funasr/runtime/python/onnxruntime/rapid_paraformer/paraformer_onnx.py@@ -26,12 +26,15 @@ class Paraformer():device_id: Union[str, int] = "-1",plot_timestamp_to: str = "",pred_bias: int = 1,+ quantize: bool = False,):if not Path(model_dir).exists():raise FileNotFoundError(f'{model_dir} does not exist.')model_file = os.path.join(model_dir, 'model.onnx')+ if quantize:+ model_file = os.path.join(model_dir, 'model_quant.onnx')config_file = os.path.join(model_dir, 'config.yaml')cmvn_file = os.path.join(model_dir, 'am.mvn')config = read_yaml(config_file)