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
install requirements automatically
游雁5942057698cc
diff --git a/funasr/download/download_from_hub.py b/funasr/download/download_from_hub.pyindex f23be0dbb..46704b096 100644--- a/funasr/download/download_from_hub.py+++ b/funasr/download/download_from_hub.py@@ -73,6 +73,8 @@ def download_from_ms(**kwargs):if isinstance(kwargs, DictConfig):kwargs = OmegaConf.to_container(kwargs, resolve=True)if os.path.exists(os.path.join(model_or_path, "requirements.txt")):+ requirements = os.path.join(model_or_path, "requirements.txt")+ print(f"Detect model requirements, begin to install it: {requirements}")from funasr.utils.install_model_requirements import install_requirementsinstall_requirements(os.path.join(model_or_path, "requirements.txt"))return kwargsdiff --git a/funasr/frontends/whisper_frontend.py b/funasr/frontends/whisper_frontend.pyindex 0598c61dc..dd61f8ea5 100644--- a/funasr/frontends/whisper_frontend.py+++ b/funasr/frontends/whisper_frontend.py@@ -1,8 +1,8 @@from typing import Tupleimport torchimport torch.nn as nn-import whisper-from whisper.audio import HOP_LENGTH, N_FFT, N_SAMPLES++from funasr.register import tablesfrom torch.nn.utils.rnn import pad_sequence@@ -26,7 +26,8 @@ class WhisperFrontend(nn.Module):super().__init__()assert fs == 16000self.fs = fs-+ import whisper+ from whisper.audio import HOP_LENGTH, N_FFT, N_SAMPLESself.n_fft = N_FFTself.win_length = N_FFTself.hop_length = HOP_LENGTH