Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Implemented CLI upload functionality #1618
Implemented CLI upload functionality #1618
Changes from 10 commits
a2be913
8a827bb
f256deb
a18eaf2
1e85ade
52ae4c6
566a243
acc570b
e84b191
fbdc017
62ab378
9c13b28
9631b80
d760b04
4833f76
f190632
ad4c6cc
f163f7a
49b43c5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This works as I would expect it to work 👌
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.
I would also kinda expect this to upload the contents of
models
tomy-cool-model
at the root ofmy-cool-model
, but it uploads them to the subfoldermodels
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.
Updated the CLI and now that's the case. Also added a unit test for this use case. By default all content is uploaded at root level unless specified differently.
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.
What is this supposed to do exactly? Reading it I understand it to be the following: upload the
my-cool-model
folder and its content to the<user>/my-cool-model
repository, the contents of the folder being at the root of the repository.However, it doesn't seem to be the case: it seems to be uploading all folders and files in the current working directory to the root of the
<user>/my-cool-model
repository. Is this expected?Reproducer:
I would expect
folder-1
to contain the contents offolder-1
, but it contains everything that was in the working directory: https://huggingface.co/lysandre/folder-1/tree/mainI would expect the command to do what it just did to be
huggingface-cli upload folder-1 .
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.
Thanks for the feedback @LysandreJik. My initial thought was that
huggingface-cli upload my-cool-model
would upload the current directory to the Hub (at root level). Sohuggingface-cli upload my-cool-model
being equivalent tohuggingface-cli upload my-cool-model . .
. A bit as when you have a local repo and you dogit add . && git commit -m "something" && git push
.That being said, the use case you've just described (e.g. repo_id == name of a local folder) is perfectly valid as well. I've updated the CLI in that sense. Now the behavior looks like this: