Repository navigation
Unsloth Studio: return the spoken text from /audio/generate instead of a truncated label - #12386
Merged
danielhanchen merged 8 commits intoOct 1, 2026
Conversation
The non-streaming audio path renders only <audio-player> and drops result.choices[0].message.content on the floor. The model returns both -- the clip and the text it spoke -- and the text is the half that is searchable, copyable, readable on a muted device, and available to a screen reader. Show the player above it, which is how a message with an attachment already reads elsewhere in the thread. A reply with no text renders exactly as before. Extracted from PR unslothai#6527, where it was one hunk inside a much larger branch; it is independent of the voice conversation mode and of every other part of it. Co-authored-by: Bardia Koopah <[email protected]> Co-authored-by: LeoBorcherding <[email protected]> Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01TSaSnTn9AUf4wPbCaTTykW
The adapter now keeps the reply text beside the player tag, but the Markdown renderer short-circuited on the tag and returned only the AudioPlayer, so the transcript was stored and never shown. The tag is split out before the text reaches the Markdown pipeline (a React-free helper, so it is unit-testable) and the player renders above the remaining text; a clip-only reply renders exactly as before. The conversation export already replaced the tag in place and kept the surrounding text, so it needed nothing. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ks, whole choices[0].message.content was a diagnostic label, '[Generated audio from: "<text[:100]>"]', which the chat now renders under the player and keeps in history. It is the spoken text itself now. The adapter drops the old label if an older backend still sends it, so it is never shown as something the assistant said. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…nd's label The previous commit changed /audio/generate to answer with the spoken text but landed without its test or the adapter's guard. This adds both: the route test asserts a 200-character prompt comes back whole, and spokenReplyText drops the old '[Generated audio from: ...]' label if an older backend still sends it, so diagnostic text is never rendered as the assistant's words. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This was referenced Oct 1, 2026
1 of 2 tasks
danielhanchen
pushed a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Oct 1, 2026
Member
|
Review record for #12386, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#297. Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found. Round 1: reviewed mirror
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces #11074, which closed automatically when its head fork was deleted.
One fix extracted from #6527 by @BardiaKoopah and @LeoBorcherding. It doesn't depend on the voice mode or benchmark PRs.
What this PR changes
/audio/generateused to answer with a status label,[Generated audio from: "<first 100 chars>"], inchoices[0].message.content. It now returns the full text the clip speaks./v1/chat/completionswith a TTS model returns the same body, so API clients and the API monitor get the real text instead of a truncated label.Scope note
An earlier revision also rendered that text under the audio player in chat. For Studio TTS the spoken text is always the user's own prompt, so it showed the same text twice (once in the user bubble, once under the player). That frontend half was removed; the chat still shows the player only, exactly as on main.