[Bugfix][FE]: Always include usage with --enable-force-include-usage (#20983)

Signed-off-by: Max Wittig <max.wittig@siemens.com>
Signed-off-by: Antoine Auger <antoineauger@users.noreply.github.com>
Co-authored-by: Antoine Auger <antoineauger@users.noreply.github.com>
This commit is contained in:
Max Wittig
2025-10-14 09:17:39 +02:00
committed by GitHub
co-authored by Antoine Auger
parent d32c611f45
commit fd85c9f426
11 changed files with 172 additions and 30 deletions
+4 -3
View File
@@ -58,6 +58,7 @@ class OpenAISpeechToText(OpenAIServing):
return_tokens_as_token_ids: bool = False,
task_type: Literal["transcribe", "translate"] = "transcribe",
log_error_stack: bool = False,
enable_force_include_usage: bool = False,
):
super().__init__(
engine_client=engine_client,
@@ -74,6 +75,8 @@ class OpenAISpeechToText(OpenAIServing):
self.model_config, task_type
)
self.enable_force_include_usage = enable_force_include_usage
self.max_audio_filesize_mb = envs.VLLM_MAX_AUDIO_CLIP_FILESIZE_MB
if self.default_sampling_params:
@@ -261,9 +264,7 @@ class OpenAISpeechToText(OpenAIServing):
completion_tokens = 0
num_prompt_tokens = 0
include_usage = (
request.stream_include_usage if request.stream_include_usage else False
)
include_usage = self.enable_force_include_usage or request.stream_include_usage
include_continuous_usage = (
request.stream_continuous_usage_stats
if include_usage and request.stream_continuous_usage_stats