LearnedVector / A-Hackers-AI-Voice-Assistant

A hackers AI voice assistant, built using Python and PyTorch.
https://www.youtube.com/playlist?list=PL5rWfvZIL-NpFXM9nFr15RmEEh4F4ePZW
MIT License
1.02k stars 358 forks source link

Running `demo.py` in Docker in ubuntu 20.04 #78

Closed jun-danieloh closed 3 years ago

jun-danieloh commented 3 years ago

Hi,

When running demo.py, I am getting this error below.

[2021-09-06 04:53:34,145] ERROR in app: Exception on /get_audio [GET]
Traceback (most recent call last):
  File "/opt/conda/lib/python3.7/site-packages/flask/app.py", line 2070, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/conda/lib/python3.7/site-packages/flask/app.py", line 1515, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/conda/lib/python3.7/site-packages/flask/app.py", line 1513, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/conda/lib/python3.7/site-packages/flask/app.py", line 1499, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "demo.py", line 28, in get_audio
    with open('transcript.txt', 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'transcript.txt'
127.0.0.1 - - [06/Sep/2021 04:53:34] "GET /get_audio HTTP/1.1" 500 -

This is a command I ran.

root@elf-desktop:/home/jun1.oh/workspace/A-Hackers-AI-Voice-Assistant/VoiceAssistant/speechrecognition/demo# python demo.py --model_file ./speechrecognition.zip

Do I need to prepare transcript.txt file for demo?

Or is this file auto-generated by voice input when demo? In this case, probably my linux computer doesn't have a microphone installed to use.

Thanks, Daniel

jun-danieloh commented 3 years ago

I solved this issue myself.