[Bugfix] Fix Qwen3ASR language asr tag in output (#33410)

Signed-off-by: NickLucche <nlucches@redhat.com>
This commit is contained in:
Nicolò Lucchesi
2026-01-31 05:24:49 +00:00
committed by GitHub
parent 8ecd213c0b
commit e77f162cf5
3 changed files with 42 additions and 2 deletions
@@ -518,7 +518,8 @@ class OpenAISpeechToText(OpenAIServing):
total_segments.extend(segments)
text_parts.extend([seg.text for seg in segments])
else:
text_parts.append(op.outputs[0].text)
raw_text = op.outputs[0].text
text_parts.append(self.model_cls.post_process_output(raw_text))
text = "".join(text_parts)
if self.task_type == "transcribe":
final_response: ResponseType
@@ -607,6 +608,10 @@ class OpenAISpeechToText(OpenAIServing):
assert len(res.outputs) == 1
output = res.outputs[0]
# TODO: For models that output structured formats (e.g.,
# Qwen3-ASR with "language X<asr_text>" prefix), streaming
# would need buffering to strip the prefix properly since
# deltas may split the tag across chunks.
delta_message = DeltaMessage(content=output.text)
completion_tokens += len(output.token_ids)