Reject oversized media before fully downloading it (#51896)
Signed-off-by: Clinton Thomas <1033162+KernelClint@users.noreply.github.com> Co-authored-by: Lucas Bourtoule <35483370+dhalf@users.noreply.github.com>
This commit is contained in:
co-authored by
Lucas Bourtoule
parent
585bb07c70
commit
2ec6f0d71e
@@ -124,7 +124,6 @@ class SpeechToTextBaseServing(GenerateBaseServing):
|
||||
|
||||
self.enable_force_include_usage = enable_force_include_usage
|
||||
|
||||
self.max_audio_filesize_mb = envs.VLLM_MAX_AUDIO_CLIP_FILESIZE_MB
|
||||
self.max_audio_decode_duration_s: int = envs.VLLM_MAX_AUDIO_DECODE_DURATION_S
|
||||
self.max_audio_decode_bytes: int = envs.VLLM_MAX_AUDIO_DECODE_BYTES
|
||||
if self.model_cls.supports_segment_timestamp:
|
||||
@@ -274,13 +273,6 @@ class SpeechToTextBaseServing(GenerateBaseServing):
|
||||
else None
|
||||
)
|
||||
|
||||
if len(audio_data) / 1024**2 > self.max_audio_filesize_mb:
|
||||
raise VLLMValidationError(
|
||||
"Maximum file size exceeded",
|
||||
parameter="audio_filesize_mb",
|
||||
value=len(audio_data) / 1024**2,
|
||||
)
|
||||
|
||||
# Run cpu intensive preprocess step in a separate thread pool executor.
|
||||
chunks, duration = await self._decode_and_chunk_speech_async(audio_data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user