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

Push empty model card and dataset card to the Hub #1261

Merged
merged 4 commits into from
Dec 12, 2022

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Dec 12, 2022

Related to https://github.com/huggingface/moon-landing/pull/4815 (private link).

Goal is to keep up-to-date an empty example of ModelCard and DatasetCard, generated by huggingface_hub. These examples will be referenced from Hub or from docs.

Cards are pushed to:

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Dec 12, 2022

The documentation is not available anymore as the PR was closed or merged.

@Wauplin Wauplin requested a review from julien-c December 12, 2022 08:41
@merveenoyan
Copy link
Contributor

it's irrelevant but, I was wondering if it would be useful to eventually automatically create these when user pushes model/dataset programmatically through huggingface_hub (we already generate for skops inside skops and for Keras in this library)

@osanseviero
Copy link
Contributor

As discussed in DM, I find using a token for the huggingface org a security risk that we could reduce, as that org has a bunch of important repos. The token could be accidentally leaked if a user does print(PRODUCTION_TOKEN) in a test, we don't notice it and run the workflow, we suddenly have an important token exposed. I suggested @Wauplin to use https://huggingface.co/templates instead.

@osanseviero
Copy link
Contributor

it's irrelevant but, I was wondering if it would be useful to eventually automatically create these when user pushes model/dataset programmatically through huggingface_hub (we already generate for skops inside skops and for Keras in this library)

huggingface_hub is the "low level" tool for people to build model cards. E.g. we have https://huggingface.co/docs/huggingface_hub/how-to-model-cards and templating mechanism. Given the model cards are very context-dependant, I'm not sure users would be very happy if we force automatically creating an empty model card for all repos.

https://github.com/huggingface/moon-landing/pull/4815 (internal) though should help significantly here as the UI will allow people to pick templates.

@Wauplin
Copy link
Contributor Author

Wauplin commented Dec 12, 2022

Thanks for the feedback @osanseviero ! I created a new user huggingface-hub-ci for which I created a write token. This token is set as environment variable in the github CI. Worse case scenario, someone successfully leaked it and has write access to huggingface-hub-ci and templates organization. Far less critical than previously done :)

Examples are now in https://huggingface.co/templates/model-card-example and https://huggingface.co/datasets/templates/dataset-card-example.

I also changed the script to exit with nice message if the logged in user doesn't have the correct access.

@julien-c
Copy link
Member

Thanks @Wauplin! i will use this in my internal PR

@julien-c
Copy link
Member

BTW i would once again advocate to remove the table of content from the templates, as the website UI includes a table of content automatically anyways

But i'll open another issue

@julien-c
Copy link
Member

(cc @meg-huggingface for this ^)

@Wauplin
Copy link
Contributor Author

Wauplin commented Dec 12, 2022

@julien-c @osanseviero mind approving the PR so that I merge it ? Since you both kinda reviewed already :)

@Wauplin Wauplin requested a review from osanseviero December 12, 2022 13:11
Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

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

tiny nit, would you mind removing the table of contents from the templates too (on the fly)?

@Wauplin
Copy link
Contributor Author

Wauplin commented Dec 12, 2022

tiny nit, would you mind removing the table of contents from the templates too (on the fly)?

Did it. It will be a good occasion to check CI works fine to push updated versions :)

@Wauplin Wauplin merged commit 62e5e4e into main Dec 12, 2022
@Wauplin Wauplin deleted the push-empty-model-card-example branch December 12, 2022 15:34
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.

5 participants