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
fix: vLLM >=0.21 compat — EmbedsPrompt moved from vllm.inputs.data to vllm.inputs
游雁39530728fec2
diff --git a/funasr/models/fun_asr_nano/inference_vllm.py b/funasr/models/fun_asr_nano/inference_vllm.pyindex 38384b509..e6cb95aeb 100644--- a/funasr/models/fun_asr_nano/inference_vllm.py+++ b/funasr/models/fun_asr_nano/inference_vllm.py@@ -167,7 +167,10 @@ class FunASRNanoVLLM:**kwargs,):from vllm import LLM, SamplingParams- from vllm.inputs.data import EmbedsPrompt+ try:+ from vllm.inputs import EmbedsPrompt+ except ImportError:+ from vllm.inputs.data import EmbedsPromptself.device = deviceself.dtype = dtype@@ -519,7 +522,10 @@ class FunASRNanoVLLM:List of result dicts: [{"key": str, "text": str, "timestamps": [...]}]"""from vllm import SamplingParams- from vllm.inputs.data import EmbedsPrompt+ try:+ from vllm.inputs import EmbedsPrompt+ except ImportError:+ from vllm.inputs.data import EmbedsPromptif isinstance(inputs, (str, np.ndarray, torch.Tensor)):inputs = [inputs]diff --git a/funasr/models/fun_asr_nano/inference_vllm_pipeline.py b/funasr/models/fun_asr_nano/inference_vllm_pipeline.pyindex d7afc2f6d..bef4cb7a2 100644--- a/funasr/models/fun_asr_nano/inference_vllm_pipeline.py+++ b/funasr/models/fun_asr_nano/inference_vllm_pipeline.py@@ -199,7 +199,10 @@ class FunASRNanoVLLMPipeline:# Step 3: Batch ASR via vLLM# Encode all segments and build promptsfrom vllm import SamplingParams- from vllm.inputs.data import EmbedsPrompt+ try:+ from vllm.inputs import EmbedsPrompt+ except ImportError:+ from vllm.inputs.data import EmbedsPromptprompts = []for seg_audio in segment_audios:diff --git a/funasr/models/fun_asr_nano/inference_vllm_streaming.py b/funasr/models/fun_asr_nano/inference_vllm_streaming.pyindex cdc17ebf1..4ff1f9ccf 100644--- a/funasr/models/fun_asr_nano/inference_vllm_streaming.py+++ b/funasr/models/fun_asr_nano/inference_vllm_streaming.py@@ -210,7 +210,10 @@ class FunASRNanoStreamingVLLM:"is_final": bool, "chunk_idx": int, "audio_duration_ms": float}"""from vllm import SamplingParams- from vllm.inputs.data import EmbedsPrompt+ try:+ from vllm.inputs import EmbedsPrompt+ except ImportError:+ from vllm.inputs.data import EmbedsPromptfrom funasr.utils.load_utils import load_audio_text_image_videochunk_ms = chunk_ms or self.chunk_msdiff --git a/funasr/models/glm_asr/inference_vllm.py b/funasr/models/glm_asr/inference_vllm.pyindex d2eaac625..73687a335 100644--- a/funasr/models/glm_asr/inference_vllm.py+++ b/funasr/models/glm_asr/inference_vllm.py@@ -192,7 +192,10 @@ class GLMASRVLLMEngine:List of {"key": str, "text": str}"""from vllm import SamplingParams- from vllm.inputs.data import EmbedsPrompt+ try:+ from vllm.inputs import EmbedsPrompt+ except ImportError:+ from vllm.inputs.data import EmbedsPromptif isinstance(inputs, (str, np.ndarray, torch.Tensor)):inputs = [inputs]diff --git a/funasr/version.txt b/funasr/version.txtindex d0149fef7..80e78df68 100644--- a/funasr/version.txt+++ b/funasr/version.txt@@ -1 +1 @@-1.3.4+1.3.5