Fix upload CLI when pushing to Space #1669
Merged
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.
In
huggingface-cli upload
command, we create the repo for the user if it doesn't exist yet. When pushing to aSpace
, the upload command fails becausespace_sdk
is not set. It fails client-side no matter if the Space already exists or not. This PR fixes this by settingspace_sdk="gradio"
by default.The reason why I prefer not to add a
--space-sdk
option is that theupload
command is not really meant to configure how the Space should be configured (in comparison tohuggingface-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.