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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/onnxruntime/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ def test_stable_diffusion_model_on_rocm_ep_str(self):
def test_load_model_from_hub_private(self):
token = os.environ.get("HF_HUB_READ_TOKEN", None)

if token is None:
if not token:
Comment on lines 974 to +977
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

self.skipTest(
"Test requires a read access token for optimum-internal-testing in the environment variable `HF_HUB_READ_TOKEN`."
)
Expand Down
Loading