[Python] SSL Certificate Verification Error with Hugging Face Transformers CLI...

Discussão em 'Python' iniciado por Stack, Dezembro 19, 2024.

  1. Stack

    Stack Membro Participativo

    I'm trying to download the TheBloke/falcon-40b-instruct-GPTQ model using the Hugging Face Transformers CLI in PowerShell on Windows 10, but I consistently encounter an SSL certificate error. It appears to be same issues if I am using a Python script or Powershell even if I try just one time in downloading the model. Here's the command I'm running:

    transformers-cli download TheBloke/falcon-40b-instruct-GPTQ


    Error Message:

    Traceback (most recent call last):
    File "C:\Users\ben\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connectionpool.py", line 466, in _make_request
    self._validate_conn(conn)
    File "C:\Users\ben\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connectionpool.py", line 1095, in _validate_conn
    conn.connect()
    ...
    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1000)


    Environment Details:

    • OS: Windows 10
    • Python Version: 3.12
    • transformers-cli version: Latest (installed via pip)
    • Network Setup: I'm running this in a corporate network, but I also tried it from home with the same result.

    What I’ve Tried:

    1. Ensuring that the CA certificates are updated via pip install --upgrade certifi.
    2. Running transformers-cli with SSL verification disabled:
      $env:CURL_CA_BUNDLE = ""
      transformers-cli download TheBloke/falcon-40b-instruct-GPTQ

      This didn't resolve the issue.
    3. Using curl with --insecure works to fetch individual files from Hugging Face, but this doesn't integrate with the transformers-cli.
    4. Tried different networks, including a home Wi-Fi network.
    5. Verified that my Python environment and requests library are up to date:
      pip install --upgrade requests urllib3 transformers huggingface_hub

    Questions:

    1. Is there a way to bypass SSL verification for the Hugging Face CLI while ensuring the download completes?
    2. Could this be related to my Python installation or specific SSL settings in Windows?
    3. Are there alternative methods to manually download and use the model files in the Hugging Face cache directory?

    Additional Info:

    • I’ve also tried downloading smaller models like tiiuae/falcon-7b-instruct but face the same issue.
    • The issue persists across multiple virtual environments.

    Any help would be greatly appreciated!

    Continue reading...

Compartilhe esta Página