Download scripts/push_space.sh from Sahek/hydra-cage: direct link, hf CLI and curl.
- Browser
- Download file 862 Bytes
-
https://huggingface.co/datasets/Sahek/hydra-cage/resolve/main/scripts/push_space.sh
- Command line
-
hf download hf://datasets/Sahek/hydra-cage/scripts/push_space.sh
-
curl -L -o push_space.sh https://huggingface.co/datasets/Sahek/hydra-cage/resolve/main/scripts/push_space.sh
862 Bytes
| # Publish the assembled Space to Hugging Face. | |
| # | |
| # ./scripts/push_space.sh Sahek/hydra-cage | |
| # | |
| # Requires: pip install "huggingface_hub[cli]" && hf auth login | |
| # The Space must already exist (or pass --create to make it). | |
| set -euo pipefail | |
| REPO="${1:-Sahek/hydra-cage}" | |
| ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | |
| "${ROOT}/scripts/build_space.sh" | |
| if ! command -v hf >/dev/null 2>&1; then | |
| echo "error: the 'hf' CLI is not installed." >&2 | |
| echo " pip install -U 'huggingface_hub[cli]' && hf auth login" >&2 | |
| exit 1 | |
| fi | |
| if [[ "${2:-}" == "--create" ]]; then | |
| hf repo create "${REPO}" --repo-type space --space_sdk docker -y || true | |
| fi | |
| hf upload "${REPO}" "${ROOT}/build/space" . \ | |
| --repo-type space \ | |
| --commit-message "Publish the Hydra Cage demonstration Space" | |
| echo | |
| echo "https://huggingface.co/spaces/${REPO}" | |