Repository navigation
fix(tts): fail the request when a chunk fails instead of dropping it - #571
Merged
Merged
Conversation
Errors from model calls and audio encoding were logged and swallowed at three levels of generate_audio_stream, so a sentence that failed was left out of an HTTP 200 with nothing to show the text was incomplete. Streams also kept going and finalized their download link file. Let those errors propagate. Non-streaming requests get the existing error response; a stream is cut off, which clients can detect, and TempFileWriter removes its file when it exits with an error so the download link never serves the truncated audio. Pause-chunk errors are unchanged.
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.
Errors from model calls and audio encoding were logged and swallowed at
three levels of generate_audio_stream, so a sentence that failed was
left out of an HTTP 200 with nothing to show the text was incomplete.
Streams also kept going and finalized their download link file.
Let those errors propagate. Non-streaming requests get the existing
error response; a stream is cut off, which clients can detect, and
TempFileWriter removes its file when it exits with an error so the
download link never serves the truncated audio. Pause-chunk errors are
unchanged.
Testing
pytest: full suite passes.test_failed_chunk_raises_instead_of_dropping_speechdrives the real_process_chunkwith a failing model call; on master the stream ends quietly with no audio.test_failed_write_removes_partial_downloadchecks the download file goes when the writer exits with an error.docker/gpu/Dockerfile.optimizedwith this and the sibling PRs merged is unchanged.Follows #562-#568 from the same review. Based on master on its own; it overlaps those PRs in the CHANGELOG
[Unreleased]section and in the imports oftemp_manager.py(#563).