-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[MagpieTTS][TTS] Streaming Algorithm for MagpieTTS to 2508 #14573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: magpietts_2508
Are you sure you want to change the base?
Conversation
Signed-off-by: subhankar-ghosh <[email protected]>
Signed-off-by: subhankar-ghosh <[email protected]>
…x attn Signed-off-by: subhankar-ghosh <[email protected]>
Signed-off-by: subhankar-ghosh <[email protected]>
Signed-off-by: subhankar-ghosh <[email protected]>
…pietts_2503_small
Signed-off-by: subhankar-ghosh <[email protected]>
Signed-off-by: Subhankar Ghosh <[email protected]>
Signed-off-by: subhankar-ghosh <[email protected]>
Signed-off-by: subhankar-ghosh <[email protected]>
…x attn Signed-off-by: subhankar-ghosh <[email protected]>
Signed-off-by: subhankar-ghosh <[email protected]>
Signed-off-by: subhankar-ghosh <[email protected]>
Signed-off-by: Subhankar Ghosh <[email protected]>
Signed-off-by: subhankar-ghosh <[email protected]>
Signed-off-by: subhankar-ghosh <[email protected]>
Signed-off-by: subhankar-ghosh <[email protected]>
Signed-off-by: subhankar-ghosh <[email protected]>
Signed-off-by: subhankar-ghosh <[email protected]>
Signed-off-by: artbataev <[email protected]>
Signed-off-by: Subhankar Ghosh <[email protected]>
Signed-off-by: subhankar-ghosh <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds streaming inference functionality to MagpieTTS, enabling real-time text-to-speech generation by processing text input incrementally rather than all at once. The streaming algorithm maintains sliding windows for both text and audio history while managing attention priors to ensure coherent audio generation across text chunks.
Key Changes:
- Implementation of streaming inference algorithm with windowing mechanisms for text and audio tokens
- Addition of specialized attention prior handling for streaming mode with exponential weight support
- Extraction of common argument parsing functionality to support both streaming and non-streaming inference scripts
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
File | Description |
---|---|
scripts/magpietts/infer_and_evaluate_streaming.py | New streaming inference script with chunked text processing and windowed generation |
nemo/collections/tts/models/magpietts.py | Core streaming methods including windowed text processing and streaming-specific attention prior construction |
scripts/magpietts/infer_and_evaluate.py | Refactored to extract common argument parsing logic and removed combined violin plot functionality |
scripts/magpietts/README.md | Added documentation and usage example for the new streaming inference capability |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
It also uses a end_of_text flag to indicate whether the text has ended. | ||
It also uses a left_offset to account for the fact that the text is not provided in a single chunk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring repeats the explanation about left_offset twice. The last two sentences are redundant and should be consolidated.
It also uses a end_of_text flag to indicate whether the text has ended. | |
It also uses a left_offset to account for the fact that the text is not provided in a single chunk. | |
It also uses an end_of_text flag to indicate whether the text has ended. |
Copilot uses AI. Check for mistakes.
Signed-off-by: Jason <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Subhankar Ghosh <[email protected]>
Hi Subhankar, nice work! I have not dived into all the details but here are a few things that come to mind:
I know that there is a tradeoff between eliminating code duplication vs making unified code overly complex, but maybe the above are worth another look?
|
Important
The
Update branch
button must only be pressed in very rare occassions.An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.
What does this PR do ?
Add streaming algorithm to magpietts
Collection: [Note which collection this PR will affect]
TTS
Usage
GitHub Actions CI
The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.
The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".
Before your PR is "Ready for review"
Pre checks:
PR Type:
If you haven't finished some of the above items you can still open "Draft" PR.
Who can review?
Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.
Additional Information