-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Faster Whisper will not run offline #116
Comments
Hi, The Whisper models are automatically downloaded from the Hugging Face Hub. To run the library offline, you should first download a model locally. For example the command below downloads the "tiny" model and saves it in the directory
Then you can load the model from its path on disk: model = WhisperModel("/path/to/tiny/model") |
Thanks that solves the problem. |
I use this command: python3 -c 'import faster_whisper; faster_whisper.download_model("tiny", "/tmp/tiny")' There will be the following error: An error occured while synchronizing the model guillaumekln/faster-whisper-tiny from the Hugging Face Hub:
(ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')), '(Request ID: 84f30144-9f6a-4a1c-b472-69891ab07522)')
Trying to load the model directly from the local cache, if it exists.
Traceback (most recent call last):
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/urllib3/connectionpool.py", line 790, in urlopen
response = self._make_request(
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/urllib3/connectionpool.py", line 496, in _make_request
conn.request(
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/urllib3/connection.py", line 395, in request
self.endheaders()
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/http/client.py", line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/http/client.py", line 1040, in _send_output
self.send(msg)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/http/client.py", line 1001, in send
self.sock.sendall(data)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/ssl.py", line 1208, in sendall
return super().sendall(data, flags)
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/urllib3/connectionpool.py", line 844, in urlopen
retries = retries.increment(
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/urllib3/util/retry.py", line 470, in increment
raise reraise(type(error), error, _stacktrace)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/urllib3/util/util.py", line 38, in reraise
raise value.with_traceback(tb)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/urllib3/connectionpool.py", line 790, in urlopen
response = self._make_request(
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/urllib3/connectionpool.py", line 496, in _make_request
conn.request(
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/urllib3/connection.py", line 395, in request
self.endheaders()
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/http/client.py", line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/http/client.py", line 1040, in _send_output
self.send(msg)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/http/client.py", line 1001, in send
self.sock.sendall(data)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/ssl.py", line 1208, in sendall
return super().sendall(data, flags)
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/faster_whisper/utils.py", line 94, in download_model
return huggingface_hub.snapshot_download(repo_id, **kwargs)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
return fn(*args, **kwargs)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/huggingface_hub/_snapshot_download.py", line 186, in snapshot_download
repo_info = api.repo_info(repo_id=repo_id, repo_type=repo_type, revision=revision, token=token)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
return fn(*args, **kwargs)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/huggingface_hub/hf_api.py", line 1868, in repo_info
return method(
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
return fn(*args, **kwargs)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/huggingface_hub/hf_api.py", line 1677, in model_info
r = get_session().get(path, headers=headers, timeout=timeout, params=params)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/requests/sessions.py", line 602, in get
return self.request("GET", url, **kwargs)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/huggingface_hub/utils/_http.py", line 63, in send
return super().send(request, *args, **kwargs)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/requests/adapters.py", line 501, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')), '(Request ID: 84f30144-9f6a-4a1c-b472-69891ab07522)')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/faster_whisper/utils.py", line 110, in download_model
return huggingface_hub.snapshot_download(repo_id, **kwargs)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
return fn(*args, **kwargs)
File "/usr/local/src/anaconda3/envs/faster-whisper/lib/python3.9/site-packages/huggingface_hub/_snapshot_download.py", line 169, in snapshot_download
with open(ref_path) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/root/.cache/huggingface/hub/models--guillaumekln--faster-whisper-tiny/refs/main' |
The command should work. Can you try again? |
Hello guillaumekln, could you reply with the instructions to locally download the Large v-3 model for faster-whisper on Mac terminal? |
Hi
Hi , I get this error:
What I did wrong? |
I believe:
|
Hello
I tried running faster-whiper offline but I keep getting the following exception:
I'm assuming its trying to download something from HF but have no idea what these files are. Does not happen if I am connected online.
Some assistance would be appreciated.
Thank you
The text was updated successfully, but these errors were encountered: