Skip to content

Skip private model loading for external contributors#2130

Merged
echarlaix merged 1 commit into
mainfrom
slow-test
Dec 19, 2024
Merged

Skip private model loading for external contributors#2130
echarlaix merged 1 commit into
mainfrom
slow-test

Conversation

@echarlaix
Copy link
Copy Markdown
Collaborator

@echarlaix echarlaix commented Dec 19, 2024

https://github.com/huggingface/optimum/actions/runs/12406440330/job/34639615964?pr=2114

FAILED tests/onnxruntime/test_modeling.py::ORTModelIntegrationTest::test_load_model_from_hub_private - huggingface_hub.errors.RepositoryNotFoundError: 401 Client Error. (Request ID: Root=1-6763cff5-38ad3a1d75a3598d6b742f30;13c34049-a28a-43d1-a22b-e79829428ccf)

Repository Not Found for url: https://huggingface.co/api/models/optimum-internal-testing/tiny-random-phi-private/tree/onnx?recursive=True&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.
Invalid username or password.

Comment on lines 974 to +977
def test_load_model_from_hub_private(self):
token = os.environ.get("HF_HUB_READ_TOKEN", None)

if token is None:
if not token:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a require_hf_token decorator in https://github.com/huggingface/optimum/blob/main/optimum/utils/testing_utils.py#L88
it's used in some places but it checks for HF_AUTH_TOKEN instead of HF_HUB_READ_TOKEN 🤔 should we use that decorator instead ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the issue seems that the token is set as an empty string instead of being set to None (so the same issue will happen for require_hf_token). Let's see if this fixes it, in which case I'll update require_hf_token

@echarlaix echarlaix merged commit 34b3d8b into main Dec 19, 2024
@echarlaix echarlaix deleted the slow-test branch December 19, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants