huggingface / huggingface_hub

The official Python client for the Huggingface Hub.
https://huggingface.co/docs/huggingface_hub
Apache License 2.0
2.02k stars 531 forks source link

Expose `RepoUrl` info in `CommitInfo` object #2487

Closed Wauplin closed 1 month ago

Wauplin commented 1 month ago

This small PR exposes repo_url info in the CommitInfo class. This will make it easier to retrieve the repo_id of a commit, typically when Model.push_to_hub creates the repo + create a commit and returns only the commit info and not the repo info (requested by @not-lain on Slack -internal- + makes sense to expose it).

Note: self.commit_url.split("/commit/")[0] is guaranteed to succeed given this (private repo), this and this are the only occurrences where the commit url is computed.

HuggingFaceDocBuilderDev commented 1 month ago

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Wauplin commented 1 month ago

Thanks for the quick review! And yeah, agree with you it should have been there way earlier :smile: