rhasspy / wyoming-addons

Docker builds for Home Assistant add-ons using Wyoming protocol
MIT License
66 stars 21 forks source link

Model fails to download - hashes do not match #1

Closed jreed509 closed 8 months ago

jreed509 commented 1 year ago

Whisper fails to download the model when starting the container.

When starting the container on 0.0.3, I'm seeing the following error:


whisper  | WARNING:wyoming_faster_whisper.download:Model hashes do not match
whisper  | WARNING:wyoming_faster_whisper.download:Expected: {'config.json': 'e5a2f85afc17f73960204cad2b002633', 'model.bin': 'ecd0fd5e2eb9390a2b31b7dd8d871bd1', 'vocabulary.txt': 'c1120a13c94a8cbb132489655cdd1854'}
whisper  | WARNING:wyoming_faster_whisper.download:Got: {'model.bin': '', 'config.json': '', 'vocabulary.txt': ''}
whisper  | INFO:__main__:Downloading FasterWhisperModel.BASE_INT8 to /data

After hanging on this message for several minutes I get the following error:


INFO:__main__:Downloading FasterWhisperModel.BASE_INT8 to /data
whisper  | Traceback (most recent call last):
whisper  |   File "/usr/lib/python3.9/urllib/request.py", line 1346, in do_open
whisper  |     h.request(req.get_method(), req.selector, req.data, headers,
whisper  |   File "/usr/lib/python3.9/http/client.py", line 1255, in request
whisper  |     self._send_request(method, url, body, headers, encode_chunked)
whisper  |   File "/usr/lib/python3.9/http/client.py", line 1301, in _send_request
whisper  |     self.endheaders(body, encode_chunked=encode_chunked)
whisper  |   File "/usr/lib/python3.9/http/client.py", line 1250, in endheaders
whisper  |     self._send_output(message_body, encode_chunked=encode_chunked)
whisper  |   File "/usr/lib/python3.9/http/client.py", line 1010, in _send_output
whisper  |     self.send(msg)
whisper  |   File "/usr/lib/python3.9/http/client.py", line 950, in send
whisper  |     self.connect()
whisper  |   File "/usr/lib/python3.9/http/client.py", line 1417, in connect
whisper  |     super().connect()
whisper  |   File "/usr/lib/python3.9/http/client.py", line 921, in connect
whisper  |     self.sock = self._create_connection(
whisper  |   File "/usr/lib/python3.9/socket.py", line 843, in create_connection
whisper  |     raise err
whisper  |   File "/usr/lib/python3.9/socket.py", line 831, in create_connection
whisper  |     sock.connect(sa)
whisper  | TimeoutError: [Errno 110] Connection timed out
whisper  | 
whisper  | During handling of the above exception, another exception occurred:
whisper  | 
whisper  | Traceback (most recent call last):
whisper  |   File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
whisper  |     return _run_code(code, main_globals, None,
whisper  |   File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
whisper  |     exec(code, run_globals)
whisper  |   File "/usr/local/lib/python3.9/dist-packages/wyoming_faster_whisper/__main__.py", line 135, in <module>
whisper  |     asyncio.run(main())
whisper  |   File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
whisper  |     return loop.run_until_complete(main)
whisper  |   File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
whisper  |     return future.result()
whisper  |   File "/usr/local/lib/python3.9/dist-packages/wyoming_faster_whisper/__main__.py", line 75, in main
whisper  |     model_dir = download_model(model, args.download_dir)
whisper  |   File "/usr/local/lib/python3.9/dist-packages/wyoming_faster_whisper/download.py", line 90, in download_model
whisper  |     with urlopen(model_url) as response:
whisper  |   File "/usr/lib/python3.9/urllib/request.py", line 214, in urlopen
whisper  |     return opener.open(url, data, timeout)
whisper  |   File "/usr/lib/python3.9/urllib/request.py", line 517, in open
whisper  |     response = self._open(req, data)
whisper  |   File "/usr/lib/python3.9/urllib/request.py", line 534, in _open
whisper  |     result = self._call_chain(self.handle_open, protocol, protocol +
whisper  |   File "/usr/lib/python3.9/urllib/request.py", line 494, in _call_chain
whisper  |     result = func(*args)
whisper  |   File "/usr/lib/python3.9/urllib/request.py", line 1389, in https_open
whisper  |     return self.do_open(http.client.HTTPSConnection, req,
whisper  |   File "/usr/lib/python3.9/urllib/request.py", line 1349, in do_open
whisper  |     raise URLError(err)
whisper  | urllib.error.URLError: <urlopen error [Errno 110] Connection timed out>
whisper exited with code 1

I believe this issue is new in 0.0.2 or 0.0.3 as I was able to run a previous version fine a few days ago and only ran into this issue when pulling the latest version today.

jreed509 commented 1 year ago

To follow-up, I did partially resolve this issue. I ended up updating the OS on this system (Ubuntu 20.04 to 22.04.2) and things started working better. That unfortunately probably masked whatever the root cause was, but regardless it appears it was something on my system and probably not an issue with this container itself.

That said, I do still get the warning about hashes not matching. Despite this, the models seem to download anyway and whisper starts successfully.

synesthesiam commented 8 months ago

Version 2.0.0 is using a new downloader: https://github.com/rhasspy/wyoming-faster-whisper/releases/tag/v2.0.0