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

Whisper 2.1.0 does not work without an internet connection #3631

Closed
doctorgaul opened this issue Jun 10, 2024 · 1 comment
Closed

Whisper 2.1.0 does not work without an internet connection #3631

doctorgaul opened this issue Jun 10, 2024 · 1 comment

Comments

@doctorgaul
Copy link

Describe the issue you are experiencing

Whisper add-on will not start if Home Assistant is not connected to the internet

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Home Assistant Operating System

Which add-on are you reporting an issue with?

Whisper

What is the version of the add-on?

2.1.0, possibly 2.0.0

Steps to reproduce the issue

  1. Disconnect Home Assistant from the internet
  2. Try to start Whisper
  3. Add on does not start

System Health information

System Information

version core-2024.6.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.6.29-haos
arch x86_64
timezone America/Chicago
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 5000
Installed Version 1.34.0
Stage running
Available Repositories 1396
Downloaded Repositories 29
HACS Data ok
Home Assistant Supervisor
host_os Home Assistant OS 12.3
update_channel stable
supervisor_version supervisor-2024.06.0
agent_version 1.6.0
docker_version 25.0.5
disk_total 125.3 GB
disk_used 43.1 GB
healthy true
supported true
host_connectivity true
supervisor_connectivity true
ntp_synchronized true
virtualization kvm
board ova
supervisor_api ok
version_api ok
installed_addons Advanced SSH & Web Terminal (18.0.0), File editor (5.8.0), Filebrowser (2.23.0_14), FTP (5.0.2), Fusion (2024.5.3), Matter Server (6.1.0), Samba Backup (5.2.0), Samba share (12.3.1), Studio Code Server (5.15.0), Z-Wave JS (0.5.0), Piper (1.5.0), Whisper (1.0.2), Silicon Labs Multiprotocol (2.4.5), Mosquitto broker (6.4.1), openWakeWord (1.10.0), Frigate (0.13.2), go2rtc (1.9.3), Glances (0.21.1), Grafana (10.0.0), Node-RED (17.0.13), Log Viewer (0.17.0), Tor (5.0.1), WireGuard (0.10.2), InfluxDB (5.0.0), ESPHome (2024.5.5), VLC (0.3.0), Portainer (2.20.1), Squeezelite (0.0.19), AMR2MQTT (2.1.2), rtl_433 (0.5.1), Zigbee2MQTT (1.38.0-1), Z-Wave JS UI (3.7.2), MariaDB (2.7.1), Assist Microphone (1.2.0), Music Assistant (2.0.4)
Dashboards
dashboards 8
resources 13
views 7
mode storage
Recorder
oldest_recorder_run May 30, 2024 at 7:03 PM
current_recorder_run June 9, 2024 at 9:07 PM
estimated_db_size 249.10 MiB
database_engine sqlite
database_version 3.44.2

Anything in the Supervisor logs that might be useful for us?

No response

Anything in the add-on logs that might be useful for us?

s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service whisper: starting
s6-rc: info: service whisper successfully started
s6-rc: info: service discovery: starting
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connection.py", line 198, in _new_conn
    sock = connection.create_connection(
  File "/usr/local/lib/python3.9/dist-packages/urllib3/util/connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.9/socket.py", line 953, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 793, in urlopen
    response = self._make_request(
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 491, in _make_request
    raise new_e
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 467, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 1099, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connection.py", line 616, in connect
    self.sock = sock = self._new_conn()
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connection.py", line 205, in _new_conn
    raise NameResolutionError(self.host, self, e) from e
urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPSConnection object at 0x7fb55d4b3910>: Failed to resolve 'huggingface.co' ([Errno -2] Name or service not known)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 589, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 847, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.9/dist-packages/urllib3/util/retry.py", line 515, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /openai/whisper-tiny/resolve/main/tokenizer.json (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7fb55d4b3910>: Failed to resolve 'huggingface.co' ([Errno -2] Name or service not known)"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/file_download.py", line 1722, in _get_metadata_or_catch_error
    metadata = get_hf_file_metadata(url=url, proxies=proxies, timeout=etag_timeout, headers=headers)
  File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/file_download.py", line 1645, in get_hf_file_metadata
    r = _request_wrapper(
  File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/file_download.py", line 372, in _request_wrapper
    response = _request_wrapper(
  File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/file_download.py", line 395, in _request_wrapper
    response = get_session().request(method=method, url=url, **params)
  File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/utils/_http.py", line 66, in send
    return super().send(request, *args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 622, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: (MaxRetryError('HTTPSConnectionPool(host=\'huggingface.co\', port=443): Max retries exceeded with url: /openai/whisper-tiny/resolve/main/tokenizer.json (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7fb55d4b3910>: Failed to resolve \'huggingface.co\' ([Errno -2] Name or service not known)"))'), '(Request ID: ee374338-9fcf-43c5-b470-2249fa86c800)')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.9/dist-packages/wyoming_faster_whisper/__main__.py", line 155, in <module>
    run()
  File "/usr/local/lib/python3.9/dist-packages/wyoming_faster_whisper/__main__.py", line 150, in run
    asyncio.run(main())
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/dist-packages/wyoming_faster_whisper/__main__.py", line 124, in main
    whisper_model = faster_whisper.WhisperModel(
  File "/usr/local/lib/python3.9/dist-packages/faster_whisper/transcribe.py", line 146, in __init__
    self.hf_tokenizer = tokenizers.Tokenizer.from_pretrained(
  File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/file_download.py", line 1221, in hf_hub_download
    return _hf_hub_download_to_cache_dir(
  File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/file_download.py", line 1325, in _hf_hub_download_to_cache_dir
    _raise_on_head_call_error(head_call_error, force_download, local_files_only)
  File "/usr/local/lib/python3.9/dist-packages/huggingface_hub/file_download.py", line 1826, in _raise_on_head_call_error
    raise LocalEntryNotFoundError(
huggingface_hub.utils._errors.LocalEntryNotFoundError: An error happened while trying to locate the file on the Hub and we cannot find the requested files in the local cache. Please check your connection and try again or make sure your Internet connection is on.
[22:31:17] INFO: Service exited with code 1 (by signal 0)

Additional information

I noticed 2.0.0 broke, but it wasn't until I dug into the logs with 2.1.0 that I discovered the issue appears to be internet related.

I'm a total layman, but from that log, it looks like Whisper is trying to download a model from HuggingFace and then stopping altogether when it can't get to it. Note that this seems to happen no matter which model I'm using. Even leaving it on tiny-int8, the add on will not start unless it can access the internet.

Anything I can do to fix this? :(

Copy link

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.

@github-actions github-actions bot added the stale label Jul 12, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants