Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip private model loading for external contributors #2130

Merged
merged 1 commit into from
Dec 19, 2024
Merged

Conversation

echarlaix
Copy link
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
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
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
28 of 30 checks passed
@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