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

Fix upload CLI when pushing to Space #1669

Merged
merged 4 commits into from
Sep 18, 2023
Merged

Fix upload CLI when pushing to Space #1669

merged 4 commits into from
Sep 18, 2023

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Sep 15, 2023

In huggingface-cli upload command, we create the repo for the user if it doesn't exist yet. When pushing to a Space, the upload command fails because space_sdk is not set. It fails client-side no matter if the Space already exists or not. This PR fixes this by setting space_sdk="gradio" by default.

The reason why I prefer not to add a --space-sdk option is that the upload command is not really meant to configure how the Space should be configured (in comparison to huggingface-cli repo create). The fact that the repo is created by default is more a "nice to have".

# This cmd currently fails
huggingface-cli upload my-cool-space README.md --repo-type=space

I'm planning to do a hot-fix release after this PR is merged as the upload command is currently unusable without it (for Spaces)


Tests are flaky at the moment. I'll fix that in a later PR.

@Wauplin Wauplin requested a review from LysandreJik September 15, 2023 10:12
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Sep 15, 2023

The documentation is not available anymore as the PR was closed or merged.

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.

Yes, looks good to me!

Initially I thought this would change the Space SDK when uploading a Space, but as it starts with repo creation and then follows with the README.md upload (and overwrite with the contents), this looks good to me.

LGTM, and down to do a patch for it!

@Wauplin
Copy link
Contributor Author

Wauplin commented Sep 18, 2023

Thanks for the review! Yeah indeed, the value shouldn't be overwritten by mistake so all good. Will make the patch ASAP.

@Wauplin Wauplin merged commit 8a5a551 into main Sep 18, 2023
2 of 3 checks passed
@Wauplin Wauplin deleted the fix-upload-cli-on-spaces branch September 18, 2023 12:30
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Wauplin added a commit that referenced this pull request Sep 18, 2023
* Fix upload CLI when pushing to Space

* fix CI
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