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
decoding
游雁664c400545b3
diff --git a/funasr/models/llm_asr/model.py b/funasr/models/llm_asr/model.pyindex e1e331d56..6e7939b4c 100644--- a/funasr/models/llm_asr/model.py+++ b/funasr/models/llm_asr/model.py@@ -449,9 +449,9 @@ class LLMASR2(nn.Module):for name, param in model.named_parameters():param.requires_grad = Falsemodel.eval()- self.llm = model- llm_dim = model.get_input_embeddings().weight.shape[-1]self.llm_dtype = llm_conf.get("llm_dtype", "fp32")+ self.llm = model.to(dtype_map[self.llm_dtype])+ llm_dim = model.get_input_embeddings().weight.shape[-1]# adaptoradaptor_class = tables.adaptor_classes.get(audio_adaptor)@@ -536,7 +536,9 @@ class LLMASR2(nn.Module):labels_ids[labels_ids == -1] = -100attention_mask[attention_mask < 0] = 0model_outputs = self.llm(- inputs_embeds=inputs_embeds, attention_mask=attention_mask, labels=labels_ids+ inputs_embeds=inputs_embeds.to(dtype_map[self.llm_dtype]),+ attention_mask=attention_mask,+ labels=labels_ids,)loss = model_outputs.loss