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
Dev gzf (#1480)
zhifu gaoc3192dffdd79
diff --git a/funasr/auto/auto_model.py b/funasr/auto/auto_model.pyindex a18224f46..47456a3ec 100644--- a/funasr/auto/auto_model.py+++ b/funasr/auto/auto_model.py@@ -162,7 +162,8 @@ class AutoModel:tokenizer = kwargs.get("tokenizer", None)if tokenizer is not None:tokenizer_class = tables.tokenizer_classes.get(tokenizer)- tokenizer = tokenizer_class(**kwargs["tokenizer_conf"])+ tokenizer_conf = kwargs.get("tokenizer_conf", {})+ tokenizer = tokenizer_class(**tokenizer_conf)kwargs["tokenizer"] = tokenizerkwargs["token_list"] = tokenizer.token_list if hasattr(tokenizer, "token_list") else Nonediff --git a/funasr/datasets/llm_datasets/datasets.py b/funasr/datasets/llm_datasets/datasets.pyindex 22151a123..d48046bd4 100644--- a/funasr/datasets/llm_datasets/datasets.py+++ b/funasr/datasets/llm_datasets/datasets.py@@ -39,8 +39,7 @@ class AudioLLMDataset(torch.utils.data.Dataset):self.float_pad_value = float_pad_valueself.prompt = kwargs.get("prompt", "Transcribe speech to text.")- self.prompt_pre = "USER: \nINSTRUCTION: {}\nINPUT: ".format(- self.prompt) # "USER: \nINSTRUCTION: {}\nnINPUT: {}\nASSISTANT: "+ self.prompt_pre = "USER: \nINSTRUCTION: {}\nINPUT: ".format(self.prompt) # "USER: \nINSTRUCTION: {}\nnINPUT: {}\nASSISTANT: "self.prompt_af = ""self.IGNORE_INDEX = kwargs.get("IGNORE_INDEX", -100)self.int_pad_value = self.IGNORE_INDEXdiff --git a/funasr/train_utils/trainer.py b/funasr/train_utils/trainer.pyindex 2a57a9bec..723a149cd 100644--- a/funasr/train_utils/trainer.py+++ b/funasr/train_utils/trainer.py@@ -401,4 +401,6 @@ class Trainer:epoch * len(self.dataloader_val) + batch_idx)for key, var in speed_stats.items():self.writer.add_scalar(f'rank{self.local_rank}_{key}/val', eval(var),- epoch * len(self.dataloader_val) + batch_idx)\ No newline at end of file+ epoch * len(self.dataloader_val) + batch_idx)++ self.model.train()\ No newline at end of filediff --git a/runtime/python/onnxruntime/funasr_onnx/punc_bin.py b/runtime/python/onnxruntime/funasr_onnx/punc_bin.pyindex d9bac14d0..1b8a1a243 100644--- a/runtime/python/onnxruntime/funasr_onnx/punc_bin.py+++ b/runtime/python/onnxruntime/funasr_onnx/punc_bin.py@@ -58,7 +58,7 @@ class CT_Transformer():model = AutoModel(model=model_dir)model_dir = model.export(quantize=quantize)- config_file = os.path.join(model_dir, 'confi.yaml')+ config_file = os.path.join(model_dir, 'config.yaml')config = read_yaml(config_file)token_list = os.path.join(model_dir, 'tokens.json')with open(token_list, 'r', encoding='utf-8') as f: