Conversation
mgaido91
reviewed
Feb 10, 2026
| else: | ||
| self.text_history = new_output | ||
| new_history = self.text_history_method.select_text_history(self.text_history) | ||
| assert len(self.text_history) > 0 |
Contributor
There was a problem hiding this comment.
I am not sure this is the right place. We might consider in the future cases where this is acceptable. I think we need to add the assert in _update_speech_history, where having 0 might cause issues. Also, please add as description of the assert an explanation of the thing with the hint of opening an issue in case someone hits the message. Something like:
assert len(self.text_history) > 0, \
"Text history is empty after selection, so audio cannot be aligned. " \
"If you encounter this message, it indicates a bug, so please open an issue at " \
"https://github.com/hlt-mt/simulstream/issues and include the steps that led to this state."
Contributor
Author
There was a problem hiding this comment.
Moved to _update_speech_history, thanks!
Co-authored-by: Marco Gaido <mgaido@fbk.eu>
Co-authored-by: Marco Gaido <mgaido@fbk.eu>
Contributor
|
LGTM, thanks |
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.
Why is needed?
The
PunctuationTextHistorymethod of StreamAtt currently returns an empty list (history) when processing a textual history ending with a strong punctuation mark. This causes anindex out of rangeerror in the audio history selection part because the textual history results in being empty. Solves #17.What does the PR do?
Modifies the
PunctuationTextHistoryto return at least one sentence before the last punctuation mark, so that we avoid empty lists. An assert is also added to the audio history part to make sure we can detect this incorrect behavior.How was the PR tested?
UTs