ggerganov / whisper.cpp

Port of OpenAI's Whisper model in C/C++
MIT License
35.47k stars 3.61k forks source link

SSL errors when trying to Generate_CoreML_Model #941

Open BuilderGuy1 opened 1 year ago

BuilderGuy1 commented 1 year ago

When running this: ./models/generate-coreml-model.sh base.en

I get this:


  def backtrace(trace: np.ndarray):
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 975, in send
    self.connect()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1454, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 512, in wrap_socket
    return self.sslsocket_class._create(
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1070, in _create
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1341, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/dac/Documents/Whisper/whisper.cpp/models/convert-whisper-to-coreml.py", line 308, in <module>
    whisper = load_model(args.model).cpu()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/whisper/__init__.py", line 131, in load_model
    checkpoint_file = _download(_MODELS[name], download_root, in_memory)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/whisper/__init__.py", line 67, in _download
    with urllib.request.urlopen(url) as source, open(download_target, "wb") as output:
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
xcrun: error: unable to find utility "coremlc", not a developer tool or in PATH
mv: rename models/coreml-encoder-base.en.mlmodelc to models/ggml-base.en-encoder.mlmodelc: No such file or directory ```
sidhire commented 1 year ago

https://github.com/ggerganov/whisper.cpp/issues/898

jadenScali commented 2 months ago

Anyone figure this out? I'm getting the exact same error and #898 didn't help. But it's weird because it worked a week ago and I'm using the same computer.

jadenScali commented 2 months ago

Anyone figure this out? I'm getting the exact same error and #898 didn't help. But it's weird because it worked a week ago and I'm using the same computer.

For anyone else having this issue. Mine was fixed by using miniconda as I had multiple conflicting versions of python installed on my machine when this requires python 3.10 to work well. (Also I uninstalled the second python version from my mac but it worked before I did so)