Skip to content

Conversation

adrinjalali
Copy link
Member

@adrinjalali adrinjalali commented Jun 10, 2022

Add implementation for init and push.

@adrinjalali adrinjalali changed the title ENH add implementation for init ENH add implementation for init and push Jun 23, 2022
@adrinjalali
Copy link
Member Author

@merveenoyan this should be ready for a review :)

Comment on lines 100 to 101
HfApi().create_repo(repo_id=repo_name, token=token, repo_type="model")

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to include this inside Hub functionalities in later versions?

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you mean? I'm not sure what "Hub functionality" refers to here. What would the users' code look like with what you're thinking?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd expect the pushing function to create the repository if it doesn't exist.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok. 84c8903 adds a create_remote parameter to allow the user to do that.

Comment on lines +175 to +179
create_remote: bool, optional
Whether to create the remote repository if it doesn't exist. If the
remote repository doesn't exist and this parameter is ``False``, it
raises an error. Otherwise it checks if the remote repository exists,
and would create it if it doesn't.
Copy link
Collaborator

@merveenoyan merveenoyan Jun 23, 2022

Choose a reason for hiding this comment

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

If this exists, why do we create_repo in examples and tests? Wouldn't it cause confusion?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've removed it from the example, but the test needs to test different scenarios, and the user might create the repo before calling this method, so the test makes sure that case is tested as well.

path_in_repo=".",
folder_path=source,
commit_message=commit_message,
commit_description=None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this needed? 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

For now I'm not exposing this to the end user, but passing it here. Passing it explicitly means if huggingface_hub decides to change the default value of this parameter, our users wouldn't notice anything cause we're already explicitly setting it anyway.

commit_message=commit_message,
commit_description=None,
token=token,
repo_type=None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is by default None and None refers to model BTW

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, same as above, I'm just explicitly setting it in case in the future the default value changes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah gotcha!

Copy link
Collaborator

@merveenoyan merveenoyan left a comment

Choose a reason for hiding this comment

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

I didn't catch anything else other than above comments, LGTM

@adrinjalali adrinjalali merged commit de6d36d into skops-dev:main Jun 23, 2022
@adrinjalali adrinjalali deleted the init branch June 23, 2022 15:42
BenjaminBossan added a commit to BenjaminBossan/skops that referenced this pull request Sep 15, 2022
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.

2 participants