Skip to content
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

Some text is replaced by later parts of the sentence #59

Open
logiota opened this issue May 27, 2024 · 2 comments
Open

Some text is replaced by later parts of the sentence #59

logiota opened this issue May 27, 2024 · 2 comments

Comments

@logiota
Copy link

logiota commented May 27, 2024

Some text is replaced by later parts of the sentence,
generally where there should be a comma.

I said: please let me know where I can find green apples
And after different text appearing the only text left was :
green apples

great work btw!

@danmaevsky
Copy link

I am getting the same issue right now. It doesn't appear to be updating like it does in the demo GIF. It is replacing the transcription line with a text snippet rather than replacing it entirely with the new phrase.

@danmaevsky
Copy link

I figured it out!
We need to keep track of the phrase and concatenate the audio stream to it until we detect that we are in a new phrase. Here is how to do it:

Before the while loop, add this line:
audio_data = b''

In the while loop, add the same line to the conditional that checks if a phrase has been completed, so that now it looks like this:

# If enough time has passed between recordings, consider the phrase complete.
# Clear the current working audio buffer to start over with the new data.
if phrase_time and now - phrase_time > timedelta(seconds=phrase_timeout):
phrase_complete = True
audio_data = b''

Lastly, replace the line that says
audio_data = b''.join(data_queue.queue)
with
audio_data = audio_data + b''.join(data_queue.queue)

In effect, this now allows the model to make a new inference on the old data + continuation of the data instead of just the continuation chunk of the data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants