-
Notifications
You must be signed in to change notification settings - Fork 570
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
[Dataset | Model card] When pushing to template repos, work on actual raw contents #1282
Conversation
(maybe a better webpage could be written about this, @lhoestq )
The documentation is not available anymore as the PR was closed or merged. |
@julien-c I get the idea of the PR. Not sure what is the optimal way to add a comment to the modelcard. I'm fine with this solution if we don't have any better simple solution. My only concern is that if we have modelcards with a comment in the metadata section, the |
About the failing tests, I don't know what the issue is. I encountered it as well on Friday 23rd afternoon but weren't sure if it was my fault or not. It seems that on staging we cannot commit a |
maybe ping @SBrandeis about the staging env failure (no rush though) |
Sleeping on this PR a bit, I think it's an okay approach. No big deal if the actual BTW we need to do it for dataset cards too. Pinging @nateraw for his opinion though, just to be sure |
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.
@julien-c this looks great to me! One small issue I noticed here is that we are pushing the rendered template instead of the template itself, so there's not any clear indication in the pushed model card repo as to where it came from/how it was created.
Maybe we add a clear link somewhere? Either as a yaml comment or perhaps some header/footer within the card? Perhaps we just pass the model_summary
jinja template variable when rendering
utils/push_repocard_examples.py
Outdated
@@ -51,14 +55,22 @@ def push_model_card_example(overwrite: bool) -> None: | |||
Card is pushed to https://huggingface.co/templates/model-card-example. | |||
""" | |||
|
|||
card = ModelCard.from_template(ModelCardData()) | |||
template = jinja2.Template(ModelCard.default_template_path.read_text()) | |||
content = template.render(card_data="{}") |
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.
maybe pass model_summary
var and include link to raw template along with perhaps some note that that's where the rendered template came from? https://raw.githubusercontent.com/huggingface/huggingface_hub/main/src/huggingface_hub/templates/modelcard_template.md
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.
Sounds good to me, WDYT @Wauplin ?
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.
I like the idea !
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.
do you want to push directly to this branch @nateraw?
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.
sure! I see you added a couple commits 11 mins ago - are you done? If so I can push to this branch directly
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.
yep i'm done!
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.
can't approve my PR but looks good to me! thx
Question: do we actually want this feature or not?
Internal Slack convo
cc @Wauplin
Details
Generated commit for model cards (would need to do the same for datasets): https://huggingface.co/templates/model-card-example/commit/901deccf5acead553f9b082aca480d966e61f355