404 error for models

I using hugging face unity api in my project. It work good until today. When its start doing request its gives error 404 on 3 modules. Like this: Attempted request to https://api-inference.huggingface.co/models/facebook/wav2vec2-base-960h failed: HTTP/1.1 404 Not Found - Not Found. I update token, check versions of models and everything is fine. Read forums, saw the same problem the day before. No one is answering. Git for Hugging Face Unity API: GitHub - huggingface/unity-api

2 Likes

Currently, the API is not functioning properly. Roughly speaking, there are at least three types of issues occurring simultaneously.

1 Like

Same here!

1 Like

The retry error and SentenceTransformers issue of them have been resolved.

I still see 404 for private models that are accessible with HF tokens.

1 Like

I am just downloading a private model using AutoTokenizer.from_pretrained(model_name, token=hf_token).
And I see this error (redacted model name):

Some layers that were to be ignored were not found in the model: {β€˜lm_head’}
Loading checkpoint shards: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 15/15 [00:01<00:00, 8.80it/s]
Traceback (most recent call last):
File β€œ/Users/pdavoodi/dev/kashkul/.venv/lib/python3.12/site-packages/huggingface_hub/utils/_http.py”, line 409, in hf_raise_for_status
response.raise_for_status()
File β€œ/Users/pdavoodi/dev/kashkul/.venv/lib/python3.12/site-packages/requests/models.py”, line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/api/models/ABC/ABC/tree/main/additional_chat_templates?recursive=False&expand=False

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

Traceback (most recent call last):
File β€œ/Users/pdavoodi/dev/kashkul/download_model.py”, line 43, in
main()
^^^^^^
File β€œ/Users/pdavoodi/dev/kashkul/download_model.py”, line 40, in main
download_model(args.model_name, args.hf_token, args.output_dir)
File β€œ/Users/pdavoodi/dev/kashkul/download_model.py”, line 24, in download_model
tokenizer = AutoTokenizer.from_pretrained(model_name, token=hf_token)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File β€œ/Users/pdavoodi/dev/kashkul/.venv/lib/python3.12/site-packages/transformers/models/auto/tokenization_auto.py”, line 1013, in from_pretrained
return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File β€œ/Users/pdavoodi/dev/kashkul/.venv/lib/python3.12/site-packages/transformers/tokenization_utils_base.py”, line 1968, in from_pretrained
for template in list_repo_templates(
^^^^^^^^^^^^^^^^^^^^
File β€œ/Users/pdavoodi/dev/kashkul/.venv/lib/python3.12/site-packages/transformers/utils/hub.py”, line 163, in list_repo_templates
for entry in list_repo_tree(
^^^^^^^^^^^^^^^
File β€œ/Users/pdavoodi/dev/kashkul/.venv/lib/python3.12/site-packages/huggingface_hub/hf_api.py”, line 3140, in list_repo_tree
for path_info in paginate(path=tree_url, headers=headers, params={β€œrecursive”: recursive, β€œexpand”: expand}):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File β€œ/Users/pdavoodi/dev/kashkul/.venv/lib/python3.12/site-packages/huggingface_hub/utils/_pagination.py”, line 37, in paginate
hf_raise_for_status(r)
File β€œ/Users/pdavoodi/dev/kashkul/.venv/lib/python3.12/site-packages/huggingface_hub/utils/_http.py”, line 459, in hf_raise_for_status
raise _format(RepositoryNotFoundError, message, response) from e
huggingface_hub.errors.RepositoryNotFoundError: 404 Client Error. (Request ID: Root=1-68373be4-46ee93762ab34ba046e48128;bf96df50-0ef0-43fe-aa61-d99773bf9c60)

Repository Not Found for url: https://huggingface.co/api/models/ABC/ABC/tree/main/additional_chat_templates?recursive=False&expand=False.
Please make sure you specified the correct repo_id and repo_type.
If you are trying to access a private or gated repo, make sure you are authenticated. For more details, see Quickstart

1 Like

requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/api/models/ABC/ABC/tree/main/additional_chat_templates?recursive=False&expand=False

I think the program is not passing tokens when searching for template files, causing an error in requests. However, there is no such part in the AutoTokenizer code itself, so I think it is in the code of the specific Tokenizer class that is actually called.

If I know which model’s Tokenizer is being used, that would be a clue…