nomic-ai / gpt4all

GPT4All: Run Local LLMs on Any Device. Open-source and available for commercial use.
https://nomic.ai/gpt4all
MIT License
70.45k stars 7.69k forks source link

SSLError when trying to download the model #3068

Open lykim200 opened 3 weeks ago

lykim200 commented 3 weeks ago

When I execute model = GPT4All("Meta-Llama-3-8B-Instruct.Q4_0.gguf") as instructed in the README, I get the following error

urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

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

Traceback (most recent call last):
  File "C:\Users\lqk4061\master\Project\ATR\Code\venv\lib\site-packages\requests\adapters.py", line 667, in send        
    resp = conn.urlopen(
  File "C:\Users\lqk4061\master\Project\ATR\Code\venv\lib\site-packages\urllib3\connectionpool.py", line 843, in urlopen
    retries = retries.increment(
  File "C:\Users\lqk4061\master\Project\ATR\Code\venv\lib\site-packages\urllib3\util\retry.py", line 519, in increment  
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='gpt4all.io', port=443): Max retries exceeded with url: /models/models3.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\lqk4061\master\Project\ATR\Code\venv\lib\site-packages\gpt4all\gpt4all.py", line 235, in __init__
    self.config: ConfigType = self.retrieve_model(model_name, model_path=model_path, allow_download=allow_download, verbose=verbose)
  File "C:\Users\lqk4061\master\Project\ATR\Code\venv\lib\site-packages\gpt4all\gpt4all.py", line 310, in retrieve_model
    available_models = cls.list_models()
  File "C:\Users\lqk4061\master\Project\ATR\Code\venv\lib\site-packages\gpt4all\gpt4all.py", line 278, in list_models
    resp = requests.get("https://gpt4all.io/models/models3.json")
  File "C:\Users\lqk4061\master\Project\ATR\Code\venv\lib\site-packages\requests\api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "C:\Users\lqk4061\master\Project\ATR\Code\venv\lib\site-packages\requests\api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Users\lqk4061\master\Project\ATR\Code\venv\lib\site-packages\requests\sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\lqk4061\master\Project\ATR\Code\venv\lib\site-packages\requests\sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\lqk4061\master\Project\ATR\Code\venv\lib\site-packages\requests\adapters.py", line 698, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='gpt4all.io', port=443): Max retries exceeded with url: /models/models3.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate 
verify failed: unable to get local issuer certificate (_ssl.c:1129)')))

Is there an alternative method to get the following README example working in python?

from gpt4all import GPT4All
model = GPT4All("Meta-Llama-3-8B-Instruct.Q4_0.gguf") # downloads / loads a 4.66GB LLM
with model.chat_session():
    print(model.generate("How can I run LLMs efficiently on my laptop?", max_tokens=1024))
JMT800 commented 3 weeks ago

i am also receiving the following SSL error when executing the above snippet.

---------------------------------------------------------------------------
SSLError                                  Traceback (most recent call last)
SSLError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1000)

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

MaxRetryError                             Traceback (most recent call last)
File [), in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
    666 try:
--> 667     resp = conn.urlopen(
    668         method=request.method,
    669         url=url,
    670         body=request.body,
    671         headers=request.headers,
    672         redirect=False,
    673         assert_same_host=False,
    674         preload_content=False,
    675         decode_content=False,
    676         retries=self.max_retries,
    677         timeout=timeout,
    678         chunked=chunked,
    679     )
    681 except (ProtocolError, OSError) as err:

...
--> 698         raise SSLError(e, request=request)
    700     raise ConnectionError(e, request=request)
    702 except ClosedPoolError as e:

SSLError: HTTPSConnectionPool(host='gpt4all.io', port=443): Max retries exceeded with url: [/models/models3.json](https://file+.vscode-resource.vscode-cdn.net/models/models3.json) (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1000)')))

ps: the proxy is correctly set as i can perform a get request to www.google.com via the following snipet

import requests

response = requests.get('https://www.google.com')
print(response.status_code)