Skip to content

Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.

fix: add repetition_penalty=1.3 to all vLLM services (fixes #2930 text repetition)

游雁793c45bfed74
diff --git a/examples/industrial_data_pretraining/fun_asr_nano/serve_vllm.py b/examples/industrial_data_pretraining/fun_asr_nano/serve_vllm.py
index 1d4bd2db6..1820f9517 100644
--- a/examples/industrial_data_pretraining/fun_asr_nano/serve_vllm.py
+++ b/examples/industrial_data_pretraining/fun_asr_nano/serve_vllm.py
@@ -107,7 +107,7 @@ def process_audio(audio_data, sr=16000, language=None, hotwords=None,
return {"text": "", "segments": [], "duration": len(audio_data) / sr}
# vLLM batch ASR
- gen_kwargs = {"max_new_tokens": 500}
+ gen_kwargs = {"max_new_tokens": 500, "repetition_penalty": 1.3}
if language:
gen_kwargs["language"] = language
if hotwords:
diff --git a/funasr/bin/_server_app.py b/funasr/bin/_server_app.py
index 03a659d9f..2b532cad8 100644
--- a/funasr/bin/_server_app.py
+++ b/funasr/bin/_server_app.py
@@ -86,6 +86,7 @@ def create_app(device: str = "cuda", preload_model: str = "auto") -> FastAPI:
kwargs = {"input": tmp_path, "batch_size": 1}
if language:
kwargs["language"] = language
+ kwargs["repetition_penalty"] = 1.3
result = asr.generate(**kwargs)
text = re.sub(r'<\|[^|]*\|>', '', result[0]["text"]).strip()
if response_format == "verbose_json":
diff --git a/funasr/version.txt b/funasr/version.txt
index 80e78df68..95b25aee2 100644
--- a/funasr/version.txt
+++ b/funasr/version.txt
@@ -1 +1 @@
-1.3.5
+1.3.6