unable to use whisper offline #1399
-
Hi, But ever since I installed it [around 3 months ago], I always had to connect to the internet to do the transcription for the first time. Subsequent usage work offline. How can I use whisper purely offline? I invoke whisper using whisper --model base.en --model_dir /home/vrgovinda/offline-backup/transcription-seva/whisper-models/ --output_dir /home/vrgovinda/Documents/sevā/Transcription_BRSM_lectures/openAI-whisper/transcripts/ --language English 3*.mp3 I get a big error list: /home/vrgovinda/.local/lib/python3.9/site-packages/whisper/transcribe.py:114: UserWarning: FP16 is not supported on CPU; using FP32 instead
warnings.warn("FP16 is not supported on CPU; using FP32 instead")
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 73, 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 -3] Temporary failure in name resolution
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 1012, in _validate_conn
conn.connect()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 353, in connect
conn = self._new_conn()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f4267b745b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/vrgovinda/.local/lib/python3.9/site-packages/requests/adapters.py", line 489, in send
resp = conn.urlopen(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause)) The error in question is this: urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /gpt-2/encodings/main/vocab.bpe (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f4267b745b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) The above error indicates that the program is trying to connect to the website
This is again reflected in this error: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net',port=443): Max retries exceeded with url: /gpt-2/encodings/main/vocab.bpe (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f4267b745b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
@vrgovinda transcribe = model.transcribe(audio=path,language="en") python3.9/site-packages/tiktoken_ext/openai_public.py: def gpt2():
mergeable_ranks = data_gym_to_mergeable_bpe_ranks(
vocab_bpe_file="/root/workspace/whisper/vocab.bpe",
encoder_json_file="/root/workspace/whisper/encoder.json",
) |
Beta Was this translation helpful? Give feedback.
-
As of some recent change Whisper now calls to the internet for vocab files. Downloading the vocab.bpe and encoder.json files from the URLs specified in openai_public.py and updating some local code will re-enable offline usage. |
Beta Was this translation helpful? Give feedback.
As of some recent change Whisper now calls to the internet for vocab files. Downloading the vocab.bpe and encoder.json files from the URLs specified in openai_public.py and updating some local code will re-enable offline usage.
- Download Vocab.bpe
- Download Encoder.json
- Install the files to a folder of your choosing, for ease of use I recommend C:\Users[username]\.cache\whisper e.g. C:\Users\nic\.cache\whisper.
- You will then need to change your local copy of openai_public.py which will be installed in your python folder e.g. python3.9/site-packages/tiktoken_ext/openai_public.py to point to where you downloaded the files. Change lines 11 and 12 to remove the URL "https://openaipublic…