-
Notifications
You must be signed in to change notification settings - Fork 824
fix: robustify the STT streaming results handling #768
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
fix: robustify the STT streaming results handling #768
Conversation
In the STT recognize_listener, the clause that handles 'results' or 'speaker_labels' was prone to index errors when the 'results' object returned by the service was empty. This can happen, so this change makes that logic safe to empty (or otherwise malformed) results.
mamoonraja
left a comment
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.
Looks good overall @gabe-l-hart , left a small comment. You will need to sign the CLA before we merge though.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
@apaparazzi0329 can you take a look |
|
Sure thing |
|
@gabe-l-hart We are looking to merge in this PR and would like to give you credit for this contribution. Would you be able to sign the CLA agreement? Everything is looking good although I have a concern over one line. |
| self.callback.on_transcription(transcripts) | ||
| if hypothesis: | ||
| self.callback.on_hypothesis(hypothesis) | ||
| self.callback.on_hypothesis(hypothesis) |
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.
Is there any reason this self.callback.on_hypothesis(hypothesis) line is kept here? The hypothesis variable is not in scope here and would throw an error if alternatives or transcript did not exist as well as send duplicate data to on_hypothesis()
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.
yikes! It's been a good long time since I looked at this, but it sure looks buggy here. I'll remove this line.
Codecov Report
@@ Coverage Diff @@
## master #768 +/- ##
==========================================
- Coverage 91.43% 91.42% -0.01%
==========================================
Files 25 25
Lines 31752 31755 +3
==========================================
Hits 29032 29032
- Misses 2720 2723 +3
Continue to review full report at Codecov.
|
apaparazzi0329
left a comment
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.
Thank you for this PR! Everything is looking good 👍
## [5.2.2](v5.2.1...v5.2.2) (2021-07-06) ### Bug Fixes * robustify the STT streaming results handling ([#768](#768)) ([264807d](264807d))
|
🎉 This PR is included in version 5.2.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
In the STT recognize_listener, the clause that handles
'results'or'speaker_labels'was prone to index errors when the'results'object returned by the service was empty. This can happen, so this change makes that logic safe to empty (or otherwise malformed) results.