Skip to content
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

Merged
merged 6 commits into from
Jul 1, 2021

Conversation

LysandreJik
Copy link
Member

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.

@LysandreJik LysandreJik force-pushed the staging-endpoint-in-var branch from 7cd9283 to e908a5a Compare June 30, 2021 08:48
@@ -51,6 +52,7 @@
DATASET_SAMPLE_PY_FILE = "custom_squad.py"


@with_production_testing
Copy link
Member Author

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

clone_from=f"{ENDPOINT_STAGING}/valid_org/{REPO_NAME}",
clone_from=f"valid_org/{REPO_NAME}",
Copy link
Member Author

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!

Comment on lines +24 to 26
ENDPOINT = (
"https://moon-staging.huggingface.co" if _staging_mode else "https://huggingface.co"
)
Copy link
Member

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
@LysandreJik LysandreJik merged commit c7fee7b into main Jul 1, 2021
@LysandreJik LysandreJik deleted the staging-endpoint-in-var branch July 1, 2021 13:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants