From e0cfa52d22a00f755a53bbed925b0c92d4290f39 Mon Sep 17 00:00:00 2001 From: christian Date: Wed, 29 Jul 2026 10:16:13 -0300 Subject: [PATCH] [Bugfix][Frontend] Return transcription and translation verbose as float (#49073) Signed-off-by: Lucas Christian --- vllm/entrypoints/speech_to_text/base/serving.py | 4 ++-- vllm/entrypoints/speech_to_text/transcription/protocol.py | 2 +- vllm/entrypoints/speech_to_text/translation/protocol.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vllm/entrypoints/speech_to_text/base/serving.py b/vllm/entrypoints/speech_to_text/base/serving.py index c646f53383..40f4cb25b1 100644 --- a/vllm/entrypoints/speech_to_text/base/serving.py +++ b/vllm/entrypoints/speech_to_text/base/serving.py @@ -644,7 +644,7 @@ class SpeechToTextBaseServing(GenerateBaseServing): TranscriptionResponseVerbose( text=text, language=request.language, - duration=str(duration_s), + duration=duration_s, segments=total_segments, ), ) @@ -658,7 +658,7 @@ class SpeechToTextBaseServing(GenerateBaseServing): TranslationResponseVerbose( text=text, language=request.language, - duration=str(duration_s), + duration=duration_s, segments=total_segments, ), ) diff --git a/vllm/entrypoints/speech_to_text/transcription/protocol.py b/vllm/entrypoints/speech_to_text/transcription/protocol.py index 3d6600fe36..dba68abe7a 100644 --- a/vllm/entrypoints/speech_to_text/transcription/protocol.py +++ b/vllm/entrypoints/speech_to_text/transcription/protocol.py @@ -384,7 +384,7 @@ class TranscriptionSegment(OpenAIBaseModel): class TranscriptionResponseVerbose(OpenAIBaseModel): - duration: str + duration: float """The duration of the input audio.""" language: str diff --git a/vllm/entrypoints/speech_to_text/translation/protocol.py b/vllm/entrypoints/speech_to_text/translation/protocol.py index 684138568e..d8836554c5 100644 --- a/vllm/entrypoints/speech_to_text/translation/protocol.py +++ b/vllm/entrypoints/speech_to_text/translation/protocol.py @@ -357,7 +357,7 @@ class TranslationSegment(OpenAIBaseModel): class TranslationResponseVerbose(OpenAIBaseModel): - duration: str + duration: float """The duration of the input audio.""" language: str