Private model usage problem
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 arevisionis encouraged when loading a configuration with custom code to ensure no malicious code has been contributed in a newer revision.Explicitly passing arevisionis 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, inmodel = 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_pretrainedpretrained_model_name_or_path, module_file + “.py”, class_name, **kwargsFile “C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\transformers\dynamic_module_utils.py”, line 382, in get_class_from_dynamic_modulelocal_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_fileuse_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_pathlocal_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_statusf"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.pyExplicitly passing arevisionis encouraged when loading a configuration with custom code to ensure no malicious code has been contributed in a newer revision.Explicitly passing arevisionis 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_pretrainedpretrained_model_name_or_path, module_file + “.py”, class_name, **kwargsFile “C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\transformers\dynamic_module_utils.py”, line 382, in get_class_from_dynamic_modulelocal_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_fileuse_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_pathlocal_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_statusf"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.
2022-10-01T14:53:54Z
Hi, I have a similar problem. Have you solved it? If yeshow?
2022-10-04T23:48:51Z
@Wauplinmay have some insights on this?
2022-10-31T16:52:18Z
You have to provide an authentication token.  SeeUser access tokens
2022-11-30T14:03:00Z
I have similar issue.i tried to accept terms as much as I can but Pipeline.from_pretrained(‘pyannote/speaker-diarization@2.1’, use_auth_token=“my token”) gave me the error like below.huggingface_hub.utils._errors.RepositoryNotFoundError: 401 Client Error: Repository Not Found for url: https://huggingface.co/pyannote/segmentation/resolve/2022.07/pytorch_model.bin. If the repo is private, make sure you are authenticated.I somehow can make it on Colab with notebook_login…Could you give me hinst?
2022-11-30T23:51:51Z
Sorry my bad.I upgraded pyannote.audio and it worked!