-
Notifications
You must be signed in to change notification settings - Fork 109
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
Support custom results/details push to hub #457
base: main
Are you sure you want to change the base?
Support custom results/details push to hub #457
Conversation
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. |
@@ -281,6 +303,31 @@ def push_to_hub( | |||
|
|||
self.recreate_metadata_card(repo_id) | |||
|
|||
def push_results_to_hub(self, repo_id: str, path_in_repo: str, private: bool | None = None): |
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.
Please add some doc, especially to explain the mechanism for the args you added (as they over-write some defaults set at the class level).
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.
Edit: just saw they were in your todo :)
@@ -281,6 +303,31 @@ def push_to_hub( | |||
|
|||
self.recreate_metadata_card(repo_id) | |||
|
|||
def push_results_to_hub(self, repo_id: str, path_in_repo: str, private: bool | None = None): |
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.
Shouldn't repo_id
be results
by default ?
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.
Same for path_in_repo
- do we want to follow as default what we had? (org/modelname/results_date.json)
self.api.upload_file( | ||
repo_id=repo_id, | ||
path_or_fileobj=details_json.encode(), | ||
path_in_repo=path_in_repo.format(task_name=task_name), |
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 you provide an example of the expected path_in_repo
?
We would also want push_to_hub to use the above 2 functions to avoid logic duplication risk |
Support custom results/details push to hub.
This PR add 2 new methods (
push_results_to_hub
andpush_details_to_hub
) to allow the user to push results/details to the Hub in a completely customizable way (fully managed by the user).The user can still call the old
push_to_hub
method to have it fully managed by the library.TODO: