---------------------------------------------------------------------------
HTTPError Traceback (most recent call last)
File f:\Programmer\python\MyAI\.venv\Lib\site-packages\huggingface_hub\utils\_http.py:402, in hf_raise_for_status(response, endpoint_name)
401 try:
--> 402 response.raise_for_status()
403 except HTTPError as e:
File f:\Programmer\python\MyAI\.venv\Lib\site-packages\requests\models.py:1026, in Response.raise_for_status(self)
1025 if http_error_msg:
-> 1026 raise HTTPError(http_error_msg, response=self)
HTTPError: 404 Client Error: Not Found for url: https://hf-mirror.com/Langboat/mengzi-t5-small/resolve/main/tokenizer_config.json
The above exception was the direct cause of the following exception:
RepositoryNotFoundError Traceback (most recent call last)
File f:\Programmer\python\MyAI\.venv\Lib\site-packages\transformers\utils\hub.py:398, in cached_file(path_or_repo_id, filename, cache_dir, force_download, resume_download, proxies, token, revision, local_files_only, subfolder, repo_type, user_agent, _raise_exceptions_for_gated_repo, _raise_exceptions_for_missing_entries, _raise_exceptions_for_connection_errors, _commit_hash, **deprecated_kwargs)
396 try:
397 # Load from URL or cache if already cached
--> 398 resolved_file = hf_hub_download(
399 path_or_repo_id,
400 filename,
401 subfolder=None if len(subfolder) == 0 else subfolder,
402 repo_type=repo_type,
403 revision=revision,
404 cache_dir=cache_dir,
405 user_agent=user_agent,
406 force_download=force_download,
407 proxies=proxies,
408 resume_download=resume_download,
409 token=token,
410 local_files_only=local_files_only,
411 )
412 except GatedRepoError as e:
File f:\Programmer\python\MyAI\.venv\Lib\site-packages\huggingface_hub\utils\_validators.py:114, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs)
112 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs)
--> 114 return fn(*args, **kwargs)
File f:\Programmer\python\MyAI\.venv\Lib\site-packages\huggingface_hub\file_download.py:1007, in hf_hub_download(repo_id, filename, subfolder, repo_type, revision, library_name, library_version, cache_dir, local_dir, user_agent, force_download, proxies, etag_timeout, token, local_files_only, headers, endpoint, resume_download, force_filename, local_dir_use_symlinks)
1006 else:
-> 1007 return _hf_hub_download_to_cache_dir(
1008 # Destination
1009 cache_dir=cache_dir,
1010 # File info
1011 repo_id=repo_id,
1012 filename=filename,
1013 repo_type=repo_type,
1014 revision=revision,
1015 # HTTP info
1016 endpoint=endpoint,
1017 etag_timeout=etag_timeout,
1018 headers=hf_headers,
1019 proxies=proxies,
1020 token=token,
1021 # Additional options
1022 local_files_only=local_files_only,
1023 force_download=force_download,
1024 )
File f:\Programmer\python\MyAI\.venv\Lib\site-packages\huggingface_hub\file_download.py:1114, in _hf_hub_download_to_cache_dir(cache_dir, repo_id, filename, repo_type, revision, endpoint, etag_timeout, headers, proxies, token, local_files_only, force_download)
1113 # Otherwise, raise appropriate error
-> 1114 _raise_on_head_call_error(head_call_error, force_download, local_files_only)
1116 # From now on, etag, commit_hash, url and size are not None.
File f:\Programmer\python\MyAI\.venv\Lib\site-packages\huggingface_hub\file_download.py:1655, in _raise_on_head_call_error(head_call_error, force_download, local_files_only)
1650 elif isinstance(head_call_error, (RepositoryNotFoundError, GatedRepoError)) or (
1651 isinstance(head_call_error, HfHubHTTPError) and head_call_error.response.status_code == 401
1652 ):
1653 # Repo not found or gated => let's raise the actual error
1654 # Unauthorized => likely a token issue => let's raise the actual error
-> 1655 raise head_call_error
1656 else:
1657 # Otherwise: most likely a connection issue or Hub downtime => let's warn the user
File f:\Programmer\python\MyAI\.venv\Lib\site-packages\huggingface_hub\file_download.py:1543, in _get_metadata_or_catch_error(repo_id, filename, repo_type, revision, endpoint, proxies, etag_timeout, headers, token, local_files_only, relative_filename, storage_folder)
1542 try:
-> 1543 metadata = get_hf_file_metadata(
1544 url=url, proxies=proxies, timeout=etag_timeout, headers=headers, token=token, endpoint=endpoint
1545 )
1546 except EntryNotFoundError as http_error:
File f:\Programmer\python\MyAI\.venv\Lib\site-packages\huggingface_hub\utils\_validators.py:114, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs)
112 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs)
--> 114 return fn(*args, **kwargs)
File f:\Programmer\python\MyAI\.venv\Lib\site-packages\huggingface_hub\file_download.py:1460, in get_hf_file_metadata(url, token, proxies, timeout, library_name, library_version, user_agent, headers, endpoint)
1459 # Retrieve metadata
-> 1460 r = _request_wrapper(
1461 method="HEAD",
1462 url=url,
1463 headers=hf_headers,
1464 allow_redirects=False,
1465 follow_relative_redirects=True,
1466 proxies=proxies,
1467 timeout=timeout,
1468 )
1469 hf_raise_for_status(r)
File f:\Programmer\python\MyAI\.venv\Lib\site-packages\huggingface_hub\file_download.py:283, in _request_wrapper(method, url, follow_relative_redirects, **params)
282 if follow_relative_redirects:
--> 283 response = _request_wrapper(
284 method=method,
285 url=url,
286 follow_relative_redirects=False,
287 **params,
288 )
290 # If redirection, we redirect only relative paths.
291 # This is useful in case of a renamed repository.
File f:\Programmer\python\MyAI\.venv\Lib\site-packages\huggingface_hub\file_download.py:307, in _request_wrapper(method, url, follow_relative_redirects, **params)
306 response = http_backoff(method=method, url=url, **params)
--> 307 hf_raise_for_status(response)
308 return response
File f:\Programmer\python\MyAI\.venv\Lib\site-packages\huggingface_hub\utils\_http.py:452, in hf_raise_for_status(response, endpoint_name)
443 message = (
444 f"{response.status_code} Client Error."
445 + "\n\n"
(...) 450 " https://huggingface.co/docs/huggingface_hub/authentication"
451 )
--> 452 raise _format(RepositoryNotFoundError, message, response) from e
454 elif response.status_code == 400:
RepositoryNotFoundError: 404 Client Error. (Request ID: Root=1-692ba3e0-1947b16107347a7c6a49e57a;183d134c-894c-4f8a-8f50-ff146e2daab5)
Repository Not Found for url: https://hf-mirror.com/Langboat/mengzi-t5-small/resolve/main/tokenizer_config.json.
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 https://huggingface.co/docs/huggingface_hub/authentication
The above exception was the direct cause of the following exception:
OSError Traceback (most recent call last)
Cell In[6], line 2
1 model_name = "Langboat/mengzi-t5-small"
----> 2 tokenizer = AutoTokenizer.from_pretrained(model_name)
3 if tokenizer.pad_token is None:
4 tokenizer.pad_token = tokenizer.eos_token
File f:\Programmer\python\MyAI\.venv\Lib\site-packages\transformers\models\auto\tokenization_auto.py:804, in AutoTokenizer.from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs)
801 return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
803 # Next, let's try to use the tokenizer_config file to get the tokenizer class.
--> 804 tokenizer_config = get_tokenizer_config(pretrained_model_name_or_path, **kwargs)
805 if "_commit_hash" in tokenizer_config:
806 kwargs["_commit_hash"] = tokenizer_config["_commit_hash"]
File f:\Programmer\python\MyAI\.venv\Lib\site-packages\transformers\models\auto\tokenization_auto.py:637, in get_tokenizer_config(pretrained_model_name_or_path, cache_dir, force_download, resume_download, proxies, token, revision, local_files_only, subfolder, **kwargs)
634 token = use_auth_token
636 commit_hash = kwargs.get("_commit_hash", None)
--> 637 resolved_config_file = cached_file(
638 pretrained_model_name_or_path,
639 TOKENIZER_CONFIG_FILE,
640 cache_dir=cache_dir,
641 force_download=force_download,
642 resume_download=resume_download,
643 proxies=proxies,
644 token=token,
645 revision=revision,
646 local_files_only=local_files_only,
647 subfolder=subfolder,
648 _raise_exceptions_for_gated_repo=False,
649 _raise_exceptions_for_missing_entries=False,
650 _raise_exceptions_for_connection_errors=False,
651 _commit_hash=commit_hash,
652 )
653 if resolved_config_file is None:
654 logger.info("Could not locate the tokenizer configuration file, will try to use the model config instead.")
File f:\Programmer\python\MyAI\.venv\Lib\site-packages\transformers\utils\hub.py:421, in cached_file(path_or_repo_id, filename, cache_dir, force_download, resume_download, proxies, token, revision, local_files_only, subfolder, repo_type, user_agent, _raise_exceptions_for_gated_repo, _raise_exceptions_for_missing_entries, _raise_exceptions_for_connection_errors, _commit_hash, **deprecated_kwargs)
416 raise EnvironmentError(
417 "You are trying to access a gated repo.\nMake sure to have access to it at "
418 f"https://huggingface.co/{path_or_repo_id}.\n{str(e)}"
419 ) from e
420 except RepositoryNotFoundError as e:
--> 421 raise EnvironmentError(
422 f"{path_or_repo_id} is not a local folder and is not a valid model identifier "
423 "listed on 'https://huggingface.co/models'\nIf this is a private repository, make sure to pass a token "
424 "having permission to this repo either by logging in with `huggingface-cli login` or by passing "
425 "`token=<your_token>`"
426 ) from e
427 except RevisionNotFoundError as e:
428 raise EnvironmentError(
429 f"{revision} is not a valid git identifier (branch name, tag name or commit id) that exists "
430 "for this model name. Check the model page at "
431 f"'https://huggingface.co/{path_or_repo_id}' for available revisions."
432 ) from e
OSError: Langboat/mengzi-t5-small is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo either by logging in with `huggingface-cli login` or by passing `token=<your_token>`
最新发布