I upload a private model for myself, and when I want to use it by âAutoModel.from_pretrainedâ there appears a error as I show bleow.
I have used huggingface-cli login with the access token with read grant and use âtrust_remote_code=Trueâ as it recommands but it still has error 401.
How can I use my private model?
Explicitly passing a revision is encouraged when loading a configuration with custom code to ensure no malicious code has been contributed in a newer revision.
Explicitly passing a revision is encouraged when loading a model with custom code to ensure no malicious code has been contributed in a newer revision.
Could not locate the model.py inside micktsai/resnet50_try.
Traceback (most recent call last):
File âtest.pyâ, line 9, in
model = AutoModel.from_pretrained(âmicktsai/resnet50_tryâ, trust_remote_code=True,use_auth_token=True)
File âC:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\transformers\models\auto\auto_factory.pyâ, line 441, in from_pretrained
pretrained_model_name_or_path, module_file + â.pyâ, class_name, **kwargs
File âC:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\transformers\dynamic_module_utils.pyâ, line 382, in get_class_from_dynamic_module
local_files_only=local_files_only,
File âC:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\transformers\dynamic_module_utils.pyâ, line 239, in get_cached_module_file
use_auth_token=use_auth_token,
File âC:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\transformers\utils\hub.pyâ, line 292, in cached_path
local_files_only=local_files_only,
File âC:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\transformers\utils\hub.pyâ, line 495, in get_from_cache
_raise_for_status(r)
File âC:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\transformers\utils\hub.pyâ, line 418, in _raise_for_status
f"401 Client Error: Repository not found for url: {response.url}. "
transformers.utils.hub.RepositoryNotFoundError: 401 Client Error: Repository not found for url: https://huggingface.co/micktsai/resnet50_try/resolve/main/model.py. If the repo is private, make sure you are authenticated.
C:\Users\User\Downloads>py test.py
Explicitly passing a revision is encouraged when loading a configuration with custom code to ensure no malicious code has been contributed in a newer revision.
Explicitly passing a revision is encouraged when loading a model with custom code to ensure no malicious code has been contributed in a newer revision.
Could not locate the model.py inside micktsai/resnet50_try.
Traceback (most recent call last):
File âtest.pyâ, line 10, in
âmicktsai/resnet50_tryâ, use_auth_token=True, trust_remote_code=True)
File âC:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\transformers\models\auto\auto_factory.pyâ, line 441, in from_pretrained
pretrained_model_name_or_path, module_file + â.pyâ, class_name, **kwargs
File âC:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\transformers\dynamic_module_utils.pyâ, line 382, in get_class_from_dynamic_module
local_files_only=local_files_only,
File âC:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\transformers\dynamic_module_utils.pyâ, line 239, in get_cached_module_file
use_auth_token=use_auth_token,
File âC:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\transformers\utils\hub.pyâ, line 292, in cached_path
local_files_only=local_files_only,
File âC:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\transformers\utils\hub.pyâ, line 495, in get_from_cache
_raise_for_status(r)
File âC:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\transformers\utils\hub.pyâ, line 418, in _raise_for_status
f"401 Client Error: Repository not found for url: {response.url}. "
transformers.utils.hub.RepositoryNotFoundError: 401 Client Error: Repository not found for url: https://huggingface.co/micktsai/resnet50_try/resolve/main/model.py. If the repo is private, make sure you are authenticated.