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

Expose RepoUrl info in CommitInfo object #2487

Merged
merged 4 commits into from
Aug 26, 2024
Merged

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Aug 26, 2024

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.

@Wauplin Wauplin requested a review from LysandreJik August 26, 2024 08:50
@HuggingFaceDocBuilderDev

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.

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

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

That would have been helpful for me once or twice in the past! Glad to see it being added.

LGTM

@Wauplin
Copy link
Contributor Author

Wauplin commented Aug 26, 2024

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

@Wauplin Wauplin merged commit bd209e7 into main Aug 26, 2024
15 of 17 checks passed
@Wauplin Wauplin deleted the expose-repo-url-in-commit-info branch August 26, 2024 10:00
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.

3 participants