SociallyIneptWeeb / LanguageLeapAI

Your Personal Multilingual AI Translator
MIT License
843 stars 171 forks source link

voice_translator.py stopping without error after attempting to send API calls to Whisper/DeepL/VoiceVox #47

Open willemjanpattyn opened 1 year ago

willemjanpattyn commented 1 year ago

Issue

I have been experimenting for hours without luck. Whenever I run voice_translator.py, it seems to stop the script after attempting to request data. It doesn't output anything as well. Very randomly, it decides to work, but 99% of the time I am unable to get it to work.

I ran Whisper and VoiceVox through Docker before, but thinking that somehow that was an issue despite having the resources, I'm hosting them currently on Colab. I've attempted using different Python versions from 3.8 to 3.11.

I've documented all my testing below. I hope this helps pinpoint something. Maybe I'm overlooking something very apparent or maybe it's a specific issue on my environment, though I'm just running on Windows 10.

Testings with voice_translator.py

I've had the best results via Docker. Where it's able to at least transcribe. But even that is unfortunately inconsistent. I've logged the contents of the variables in voice_translator.py where it shows it doesn't pass after DeepL. image

I even went as far as omitting certain steps:

Skipping transcription No result from DeepL, script stops without throwing error. image

Skipping translation Here it seems to get responses from both audio_query and synthesis calls, but stops before playing the audio. Also no error thrown. image

Testings with module scripts

However, it succeeds the calls running the scripts manually. Same result with either Docker or Colab. voicevox.py (I even tried translating here) image asr.py image

Extra info

For some reason, I'm not able to see the logs in Docker. But when I switched to Colab, it's logging bad requests whenever the transcribe fails when running voice_translator.py. The 200 responses were from the times I manually ran asr.py. image

willemjanpattyn commented 1 year ago

I've worked out that the problem resides in the keyboard events somehow prematurely exiting the script. So for now, I've made two separate scripts: One script that records the voice and saves it to a file. And one that reads the saved file and pushes it through the rest of the code.

That seems to work. I will need to do further investigation as to why this happens.