-
Notifications
You must be signed in to change notification settings - Fork 629
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
More robust endpoint with toggled staging endpoint #148
Conversation
7cd9283
to
e908a5a
Compare
@@ -51,6 +52,7 @@ | |||
DATASET_SAMPLE_PY_FILE = "custom_squad.py" | |||
|
|||
|
|||
@with_production_testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This decorator enables running test on the hf.co endpoint rather than the moon-staging endpoint. I think it's good practice to explicitly opt-in for production testing
tests/test_repository.py
Outdated
clone_from=f"{ENDPOINT_STAGING}/valid_org/{REPO_NAME}", | ||
clone_from=f"valid_org/{REPO_NAME}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These cases can now be tested!
ENDPOINT = ( | ||
"https://moon-staging.huggingface.co" if _staging_mode else "https://huggingface.co" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the CI env var itself could be the endpoint https://moon-staging.huggingface.co
which would be neat b/c then this doesn't appear in the code
* Allow passing only model ID to clone when authenticated * Enable dataset repositories (#151) * Enable dataset repositories * Address Julien's review * Better API
This PR switches the default endpoint to use the moon-landing endpoint when the
HUGGINGFACE_CO_STAGING
environment variable is set.Doing this enables testing for HF Hub IDs without needing to specify the moon-landing endpoint explicitly, in turn adding coverage for the user/organization and model ID identification.