sentence-transformers: HTTPError: 403 Client Error:

I get a request error and I do not know why.


[W 2021-02-02 18:43:15,951] Trial 0 failed because of the following error: HTTPError('403 Client Error: Forbidden for url: https://sbert.net/models/bert-base-german-dbmdz-uncased.zip',)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/optuna/_optimize.py", line 211, in _run_trial
    value_or_values = func(trial)
  File "<ipython-input-6-af5cb77f5b44>", line 40, in objective
    model = SentenceTransformer(model_name)  # distiluse-base-multilingual-cased-v2  distilbert-multilingual-nli-stsb-quora-ranking
  File "/usr/local/lib/python3.6/dist-packages/sentence_transformers/SentenceTransformer.py", line 92, in __init__
    raise e
  File "/usr/local/lib/python3.6/dist-packages/sentence_transformers/SentenceTransformer.py", line 75, in __init__
    http_get(model_url, zip_save_path)
  File "/usr/local/lib/python3.6/dist-packages/sentence_transformers/util.py", line 201, in http_get
    req.raise_for_status()
  File "/usr/local/lib/python3.6/dist-packages/requests/models.py", line 941, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://sbert.net/models/bert-base-german-dbmdz-uncased.zip

HTTPError: 403 Client Error: Forbidden for url: https://sbert.net/models/bert-base-german-dbmdz-uncased.zip

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 15 (6 by maintainers)

Most upvoted comments

There is currently an issue with the huggingface model hub, that specific files cannot be accessed. This affects each model and each user.

We currently look into this.

Have a look at: https://github.com/UKPLab/sentence-transformers/issues/1297

Current work-around is to access https://sbert.net/models and to download the needed model from there, unzip it and load it from disc.

I have a similar error although it was the first time I requested it today. Is there another limit?

model2 = SentenceTransformer(‘all-mpnet-base-v2’) Traceback (most recent call last): File “<stdin>”, line 1, in <module> File “C:\Python36\lib\site-packages\sentence_transformers\SentenceTransformer.py”, line 84, in init ignore_files=[‘flax_model.msgpack’, ‘rust_model.ot’, ‘tf_model.h5’]) File “C:\Python36\lib\site-packages\sentence_transformers\util.py”, line 460, in snapshot_download user_agent=user_agent, File “C:\Python36\lib\site-packages\huggingface_hub\file_download.py”, line 351, in cached_download r.raise_for_status() File “C:\Python36\lib\site-packages\requests\models.py”, line 943, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/sentence-transformers/all-mpnet-base-v2/resolve/86eb780758622d085bac2d7f6aea99c157a5ee28/.gitattributes