Files
FunASR/tests
Leoy b7b952d3aa fix: avoid CUDA crash from repetition_penalty in Fun-ASR-Nano vLLM prompt-embeds mode (#2948) (#2974)
The Fun-ASR-Nano vLLM serving paths run with enable_prompt_embeds=True, so
requests carry audio/text embeddings and have no prompt token IDs. vLLM applies
repetition_penalty by scattering over the prompt token IDs, so any value other
than 1.0 indexes an empty tensor and aborts the engine with a CUDA
"scatter gather index out of bounds" assertion (issue #2948).

The batch generate() entry already defaulted to 1.0, but the OpenAI/REST server
(_server_app), the pipeline path and the streaming path still hardcoded
repetition_penalty=1.3 and crashed. Centralize the rule in a dependency-free
helper (resolve_repetition_penalty) that forces the neutral value in
prompt-embeds mode and warns once, and route every Fun-ASR-Nano SamplingParams
through it. The pipeline and streaming paths now also honor a caller-supplied
repetition_penalty (sanitized) instead of ignoring it.

Adds tests/test_fun_asr_nano_repetition_penalty.py (no GPU or vLLM required).
2026-06-15 09:31:04 -07:00
..
2024-04-24 16:03:38 +08:00
2024-04-24 16:03:38 +08:00