Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Unauthorized when trying to access model weights from huggingface #16

Open
sebbyjp opened this issue Nov 6, 2023 · 0 comments
Open

Comments

@sebbyjp
Copy link

sebbyjp commented Nov 6, 2023

>>> import torch
>>> model = torch.hub.load("conceptofmind/PaLM", "palm_410m_8k_v0")
/Users/sebastianperalta/simply/dev/PaLM/venv/lib/python3.11/site-packages/torch/hub.py:294: UserWarning: You are about to download and run code from an untrusted repository. In a future release, this won't be allowed. To add the repository to your trusted list, change the command to {calling_fn}(..., trust_repo=False) and a command prompt will appear asking for an explicit confirmation of trust, or load(..., trust_repo=True), which will assume that the prompt is to be answered with 'yes'. You can also use load(..., trust_repo='check') which will only prompt for confirmation if the repo is not already trusted. This will eventually be the default behaviour
  warnings.warn(
Downloading: "https://github.com/conceptofmind/PaLM/zipball/main" to /Users/sebastianperalta/.cache/torch/hub/main.zip
Downloading: "https://huggingface.co/conceptofmind/palm-410m/resolve/main/palm_410m_8k_v0.pt" to /Users/sebastianperalta/.cache/torch/hub/checkpoints/palm_410m_8k_v0.pt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/sebastianperalta/simply/dev/PaLM/venv/lib/python3.11/site-packages/torch/hub.py", line 566, in load
    model = _load_local(repo_or_dir, model, *args, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sebastianperalta/simply/dev/PaLM/venv/lib/python3.11/site-packages/torch/hub.py", line 595, in _load_local
    model = entry(*args, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sebastianperalta/.cache/torch/hub/conceptofmind_PaLM_main/hubconf.py", line 35, in palm_410m_8k_v0
    state_dict = torch.hub.load_state_dict_from_url(hf_url)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sebastianperalta/simply/dev/PaLM/venv/lib/python3.11/site-packages/torch/hub.py", line 766, in load_state_dict_from_url
    download_url_to_file(url, cached_file, hash_prefix, progress=progress)
  File "/Users/sebastianperalta/simply/dev/PaLM/venv/lib/python3.11/site-packages/torch/hub.py", line 620, in download_url_to_file
    u = urlopen(req)
        ^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 525, in open
    response = meth(req, response)
               ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 634, in http_response
    response = self.parent.error(
               ^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 563, in error
    return self._call_chain(*args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 401: Unauthorized
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant