RemoteEntryNotFoundError beim Herunterladen von Modellen von Hugging Face in KagglePython

Python-Programme
Anonymous
 RemoteEntryNotFoundError beim Herunterladen von Modellen von Hugging Face in Kaggle

Post by Anonymous »

Vor kurzem bekomme ich einige seltsame Fehlermeldungen, zum Beispiel RemoteEntryNotFoundError: 404 Client Error. (Anfrage-ID: Root=1-68e82630-293b962044bc3e6c1453ec73;43987a97-e033-4590-951e-829a3c87d2cb) Eintrag für URL nicht gefunden: https://huggingface.co/api/models/sente ... pand=false. „additional_chat_templates existiert nicht auf „main“
Das Codebeispiel:

Code: Select all

from transformers import AutoTokenizer
text_model_name = "sentence-transformers/clip-ViT-B-32-multilingual-v1"
tokenizer = AutoTokenizer.from_pretrained(text_model_name)
Tatsächlich ist dieser Fehler bei jedem Tokenizer aufgetreten, egal bei welchem.
Was wichtig ist, ich habe nichts an meinem Code geändert.
Das vollständige Fehlerprotokoll:

Code: Select all

---------------------------------------------------------------------------
HTTPStatusError                           Traceback (most recent call last)
/usr/local/lib/python3.11/dist-packages/huggingface_hub/utils/_http.py in hf_raise_for_status(response, endpoint_name)
556     try:
--> 557         response.raise_for_status()
558     except httpx.HTTPStatusError as e:

/usr/local/lib/python3.11/dist-packages/httpx/_models.py in raise_for_status(self)
828         message = message.format(self, error_type=error_type)
--> 829         raise HTTPStatusError(message, request=request, response=self)
830

HTTPStatusError: Client error '404 Not Found' for url 'https://huggingface.co/api/models/sentence-transformers/clip-ViT-B-32-multilingual-v1/tree/main/additional_chat_templates?recursive=false&expand=false'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404

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

RemoteEntryNotFoundError                  Traceback (most recent call last)
/tmp/ipykernel_37/769844608.py in ()
----> 1 tokenizer = AutoTokenizer.from_pretrained(text_model_name)

/usr/local/lib/python3.11/dist-packages/transformers/models/auto/tokenization_auto.py in from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs)
1067
1068             if tokenizer_class_fast and (use_fast or tokenizer_class_py is None):
-> 1069                 return tokenizer_class_fast.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
1070             else:
1071                 if tokenizer_class_py is not None:

/usr/local/lib/python3.11/dist-packages/transformers/tokenization_utils_base.py in from_pretrained(cls, pretrained_model_name_or_path, cache_dir, force_download, local_files_only, token, revision, trust_remote_code, *init_inputs, **kwargs)
1955                                 )
1956                     else:
-> 1957                         for template in list_repo_templates(
1958                             pretrained_model_name_or_path,
1959                             local_files_only=local_files_only,

/usr/local/lib/python3.11/dist-packages/transformers/utils/hub.py in list_repo_templates(repo_id, local_files_only, revision, cache_dir)
159     if not local_files_only:
160         try:
--> 161             return [
162                 entry.path.removeprefix(f"{CHAT_TEMPLATE_DIR}/")
163                 for entry in list_repo_tree(

/usr/local/lib/python3.11/dist-packages/transformers/utils/hub.py in [*](.0)
159     if not local_files_only:
160         try:
--> 161             return [
162                 entry.path.removeprefix(f"{CHAT_TEMPLATE_DIR}/")
163                 for entry in list_repo_tree(

/usr/local/lib/python3.11/dist-packages/huggingface_hub/hf_api.py in list_repo_tree(self, repo_id, path_in_repo, recursive, expand, revision, repo_type, token)
3050         encoded_path_in_repo = "/" + quote(path_in_repo, safe="") if path_in_repo else ""
3051         tree_url = f"{self.endpoint}/api/{repo_type}s/{repo_id}/tree/{revision}{encoded_path_in_repo}"
-> 3052         for path_info in paginate(path=tree_url, headers=headers, params={"recursive": recursive, "expand": expand}):
3053             yield (RepoFile(**path_info) if path_info["type"] == "file" else RepoFolder(**path_info))
3054

/usr/local/lib/python3.11/dist-packages/huggingface_hub/utils/_pagination.py in paginate(path, params, headers)
35     session = get_session()
36     r = session.get(path, params=params, headers=headers)
---> 37     hf_raise_for_status(r)
38     yield from r.json()
39

/usr/local/lib/python3.11/dist-packages/huggingface_hub/utils/_http.py in hf_raise_for_status(response, endpoint_name)
569         elif error_code == "EntryNotFound":
570             message = f"{response.status_code} Client Error." + "\n\n"  + f"Entry Not Found for url: {response.url}."
--> 571             raise _format(RemoteEntryNotFoundError, message, response) from e
572
573         elif error_code == "GatedRepo":

RemoteEntryNotFoundError: 404 Client Error. (Request ID: Root=1-68e82630-293b962044bc3e6c1453ec73;43987a97-e033-4590-951e-829a3c87d2cb)

Entry Not Found for url: https://huggingface.co/api/models/sentence-transformers/clip-ViT-B-32-multilingual-v1/tree/main/additional_chat_templates?recursive=false&expand=false.
additional_chat_templates does not exist on "main"
Auch in einigen Fällen, als ich versuchte, das Problem zu beheben, bekam ich OSError, aber ich habe das Protokoll nicht gespeichert :(
Ich habe versucht:
  • mit HF-Token zu autorisieren und dachte, ich werde autorisieren, aber es trat ein seltsamer Fehler auf, wie „Erneut autorisieren und erneut versuchen“
  • um das Notebook für den Fall neu zu laden Es handelte sich um eine fehlerhafte Datei und es war genau das Gleiche
  • es auf GPU und CPU zu tun und es war genau das Gleiche
  • Transformatoren zu aktualisieren bc vielleicht gab es ein Update und ein OSErorr ist aufgetreten
  • einfach einen ganzen Tag warten (nichts hat sich geändert)

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post