| #!/usr/bin/env bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| set -euo pipefail |
|
|
| MODE=docker |
| if [ "${1:-}" = "--zerogpu" ]; then MODE=zerogpu; shift; fi |
| SPACE_ID="${1:-build-small-hackathon/ars-fabula-vn}" |
| export PATH="$HOME/.local/bin:$PATH" |
|
|
| echo "ββ deploying as: $(hf auth whoami) (mode: $MODE)" |
|
|
| if [ "$MODE" = "docker" ]; then |
| |
| |
| |
| hf repos create "$SPACE_ID" --type space --space-sdk docker \ |
| --flavor t4-medium --sleep-time 1800 --exist-ok |
| else |
| hf repos create "$SPACE_ID" --type space --space-sdk gradio --exist-ok |
| fi |
|
|
| |
| |
| |
| EXTRA_EXCLUDES=() |
| if [ "$MODE" = "zerogpu" ]; then |
| EXTRA_EXCLUDES=(--exclude "README.md" --exclude "Dockerfile") |
| fi |
|
|
| |
| |
| |
| hf upload "$SPACE_ID" . . --type space \ |
| "${EXTRA_EXCLUDES[@]}" \ |
| --exclude ".git/*" \ |
| --exclude ".venv/*" \ |
| --exclude ".venv-convert/*" \ |
| --exclude "**/__pycache__/*" \ |
| --exclude ".agents/*" \ |
| --exclude ".claude/*" \ |
| --exclude "logs/*" \ |
| --exclude "saves/*" \ |
| --exclude "tests/*" \ |
| --exclude "runs/*" \ |
| --exclude "data/*" \ |
| --exclude "tools/_*" \ |
| --exclude "tools/modal_train.py" \ |
| --exclude "tools/transform_vn_dataset.py" \ |
| --exclude "tools/merge_train_data.py" \ |
| --exclude "tools/eval_generations.py" \ |
| --exclude "tools/build_sft_dataset.py" \ |
| --exclude "tools/ab_local_eval.py" \ |
| --exclude "CLAUDE.md" \ |
| --exclude "FIELD_NOTES.md" \ |
| --exclude "next_session.md" \ |
| --exclude "_gen_sprites.py" \ |
| --exclude "static/sprites/_sampler_test/*" \ |
| --exclude "static/sprites/generated/*" \ |
| --exclude "static/voice/*" \ |
| --exclude "*Zone.Identifier*" \ |
| --exclude "*PG\$Secure*" \ |
| --commit-message "Deploy Ars Fabula VN ($MODE)" |
|
|
| if [ "$MODE" = "zerogpu" ]; then |
| hf upload "$SPACE_ID" .space-zerogpu/README.md README.md --type space \ |
| --commit-message "ZeroGPU variant README (sdk: gradio)" |
| fi |
|
|
| echo "ββ done: https://huggingface.co/spaces/${SPACE_ID}" |
| echo "ββ watch the build: https://huggingface.co/spaces/${SPACE_ID}?logs=build" |
|
|