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

Expose a function to update the meta data in the readme #835

Closed
lvwerra opened this issue Apr 12, 2022 · 2 comments · Fixed by #844
Closed

Expose a function to update the meta data in the readme #835

lvwerra opened this issue Apr 12, 2022 · 2 comments · Fixed by #844

Comments

@lvwerra
Copy link
Member

lvwerra commented Apr 12, 2022

As discussed in huggingface/evaluate#6 we would like a function to update the meta data in the readme of a repo:

huggingface_hub.metadata_update(
  repo_id="lvwerra/my_model",
  update={"metrics": new_value}
)

This would enable to programmatically update meta data such as metrics from the evaluate, datasets, or transformers libraries.

There are two use-cases:

  1. The key does not exist yet so we add an entry.
  2. The key does already exist but needs to be updated - in that case we might want a overwrite=True option as safety.

What do you think @julien-c, @osanseviero? I can have a look at this if you want.

@julien-c
Copy link
Member

sounds good to me!

this can use the existing metadata-related functions under the hood, and maybe rely on upload_file so it doesn't need a local install of git

@osanseviero
Copy link
Contributor

Yes, I think using single file download + metadata_load/metadata_save (https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/repocard.py) + upload_file would be very good idea

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants