From f715f25f290d2a610b142656eb0a4c99ae0d110d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20P=C3=A9rez=20de=20Algaba?= <124347725+jperezdealgaba@users.noreply.github.com> Date: Fri, 12 Jun 2026 11:58:08 +0200 Subject: [PATCH] Fix misleading error for audio duration limit rejection (#45113) Signed-off-by: jperezde --- vllm/entrypoints/speech_to_text/base/serving.py | 2 ++ vllm/multimodal/media/audio.py | 15 +++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/vllm/entrypoints/speech_to_text/base/serving.py b/vllm/entrypoints/speech_to_text/base/serving.py index 9c0ecac41c..b60ac6ff95 100644 --- a/vllm/entrypoints/speech_to_text/base/serving.py +++ b/vllm/entrypoints/speech_to_text/base/serving.py @@ -172,6 +172,8 @@ class OpenAISpeechToText(OpenAIServing): sr=self.asr_config.sample_rate, max_duration_s=self.max_audio_decode_duration_s, ) + except ValueError: + raise except Exception as exc: raise ValueError("Invalid or unsupported audio file.") from exc diff --git a/vllm/multimodal/media/audio.py b/vllm/multimodal/media/audio.py index 1a7d6d9507..5e998be3fc 100644 --- a/vllm/multimodal/media/audio.py +++ b/vllm/multimodal/media/audio.py @@ -92,8 +92,9 @@ def load_audio_pyav( raise ValueError( f"Audio exceeds maximum allowed duration of " f"{max_duration_s}s (metadata reports " - f"{metadata_duration_s:.1f}s). This limit " - f"prevents decompression-bomb attacks." + f"{metadata_duration_s:.1f}s). Set " + f"VLLM_MAX_AUDIO_DECODE_DURATION_S to " + f"increase this limit." ) max_samples = ( @@ -129,8 +130,9 @@ def load_audio_pyav( raise ValueError( f"Audio exceeds maximum allowed duration of " f"{max_duration_s}s (decoded {total_samples} " - f"samples at {sr}Hz). This limit prevents " - f"decompression-bomb attacks." + f"samples at {sr}Hz). Set " + f"VLLM_MAX_AUDIO_DECODE_DURATION_S to " + f"increase this limit." ) except (ValueError, ImportError): raise @@ -166,8 +168,9 @@ def load_audio_soundfile( raise ValueError( f"Audio exceeds maximum allowed duration of " f"{max_duration_s}s (file contains " - f"{file_duration_s:.1f}s at {native_sr}Hz). " - f"This limit prevents decompression-bomb attacks." + f"{file_duration_s:.1f}s at {native_sr}Hz). Set " + f"VLLM_MAX_AUDIO_DECODE_DURATION_S to " + f"increase this limit." ) y = f.read(dtype="float32", always_2d=False).T