Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: from_pretrained() gives HTTP Error 401: Unauthorized #137

Open
tleyden opened this issue Jul 18, 2023 · 2 comments
Open

bug: from_pretrained() gives HTTP Error 401: Unauthorized #137

tleyden opened this issue Jul 18, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@tleyden
Copy link

tleyden commented Jul 18, 2023

Describe the bug

Calling Whisper.from_pretrained("base") gives an error:

>>> whisper = Whisper.from_pretrained("base")
Downloading model base. It may take a while...Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/miniconda3/envs/misc/lib/python3.10/site-packages/whispercpp/__init__.py", line 106, in from_pretrained
    utils.download_model(model_name, basedir=basedir), no_state=no_state
  File "/opt/miniconda3/envs/misc/lib/python3.10/site-packages/whispercpp/utils.py", line 71, in download_model
    request.urlretrieve(MODELS_URL[model_name], model_path)
  File "/opt/miniconda3/envs/misc/lib/python3.10/urllib/request.py", line 241, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/opt/miniconda3/envs/misc/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/miniconda3/envs/misc/lib/python3.10/urllib/request.py", line 525, in open
    response = meth(req, response)
  File "/opt/miniconda3/envs/misc/lib/python3.10/urllib/request.py", line 634, in http_response
    response = self.parent.error(
  File "/opt/miniconda3/envs/misc/lib/python3.10/urllib/request.py", line 563, in error
    return self._call_chain(*args)
  File "/opt/miniconda3/envs/misc/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/opt/miniconda3/envs/misc/lib/python3.10/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

When I try to manually open the url (https://huggingface.co/datasets/ggerganov/whisper.cpp/resolve/main/ggml-base.bin) in the browser, hugging face is popping up a login dialog.

Screenshot 2023-07-18 at 1 39 31 PM

To reproduce

  1. Create conda environment with python 3.10
  2. pip install whispercpp
  3. Open python shell
  4. from whispercpp import Whisper
  5. whisper = Whisper.from_pretrained("base")

Expected behavior

No errors

Environment

python: 3.10
platform: OSX 13 (apple silicon)

@tleyden tleyden added the bug Something isn't working label Jul 18, 2023
@tleyden
Copy link
Author

tleyden commented Jul 18, 2023

Installing the latest version via pip install git+https://github.com/aarnphm/whispercpp.git -vv fixes the issue.

Since it seems like some pretty basic functionality is broken in the pypi release version, it might be good to push another release to pypi or add something to the README to warn users. Not sure if I could help w /the pypi stuff, but I'd be happy to submit a PR to update the README.

@chrisspen
Copy link

That didn't work for me. That just gives me the error:

Running command git submodule update --init --recursive -q
fatal: remote error: upload-pack: not our ref c9d5095f0c64455b201f1cd0b547efcf093ee7c3
fatal: Fetched in submodule path 'extern/whispercpp/bindings/ios', but it did not contain c9d5095f0c64455b201f1cd0b547efcf093ee7c3. Direct fetching of that commit failed.
fatal:
fatal: Failed to recurse into submodule path 'extern/whispercpp'
error: subprocess-exited-with-error

× git submodule update --init --recursive -q did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: git submodule update --init --recursive -q
cwd: /tmp/pip-req-build-4d807i0h
error: subprocess-exited-with-error

× git submodule update --init --recursive -q did not run successfully.
│ exit code: 1
╰─> See above for output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants