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
onnx
游雁f3b25b07545d
diff --git a/funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/paraformer_onnx.py b/funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/paraformer_onnx.pyindex e52000826..621b9038b 100644--- a/funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/paraformer_onnx.py+++ b/funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/paraformer_onnx.py@@ -41,8 +41,8 @@ class Paraformer():self.ort_infer = OrtInferSession(model_file, device_id)self.batch_size = batch_size- def __call__(self, wav_content: Union[str, np.ndarray, List[str]]) -> List:- waveform_list = self.load_data(wav_content)+ def __call__(self, wav_content: Union[str, np.ndarray, List[str]], fs: int = None) -> List:+ waveform_list = self.load_data(wav_content, fs)waveform_nums = len(waveform_list)asr_res = []@@ -63,9 +63,9 @@ class Paraformer():return asr_resdef load_data(self,- wav_content: Union[str, np.ndarray, List[str]]) -> List:+ wav_content: Union[str, np.ndarray, List[str]], fs: int = None) -> List:def load_wav(path: str) -> np.ndarray:- waveform, _ = librosa.load(path, sr=None)+ waveform, _ = librosa.load(path, sr=fs)return waveformif isinstance(wav_content, np.ndarray):diff --git a/funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/utils/frontend.py b/funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/utils/frontend.pyindex 9f0c5354f..eb8a7c869 100644--- a/funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/utils/frontend.py+++ b/funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/utils/frontend.py@@ -21,7 +21,7 @@ class WavFrontend():fs: int = 16000,window: str = 'hamming',n_mels: int = 80,- frame_length: int = 25.0,+ frame_length: int = 25,frame_shift: int = 10,filter_length_min: int = -1,filter_length_max: float = -1,