#!/usr/bin/env bash # Push hf_prebackbone_demo to https://huggingface.co/spaces/vinayedula/RefDiffNet set -euo pipefail cd "$(dirname "$0")" SPACE_REMOTE="${SPACE_REMOTE:-https://huggingface.co/spaces/vinayedula/RefDiffNet}" if [[ ! -f weights/prebackbone_a11_ca.pt ]]; then echo "Run: bash prepare_space.sh (or extract_prebackbone_weights.py)" exit 1 fi git init git lfs install 2>/dev/null || true git add \ app.py \ a11_ca.py \ prebackbone_infer.py \ gradio_patch.py \ extract_prebackbone_weights.py \ deploy_to_refdiffnet.sh \ prepare_space.sh \ requirements.txt \ setup.sh \ README.md \ .gitattributes \ .gitignore \ examples/ \ weights/prebackbone_a11_ca.pt if ! git diff --cached --quiet; then git commit -m "RefDiffNet: standalone A11_CA prebackbone demo" elif ! git rev-parse HEAD >/dev/null 2>&1; then echo "ERROR: No commit to push. Check git add / files." exit 1 else echo "No new changes; pushing existing commit." fi git branch -M main if git remote get-url origin &>/dev/null; then git remote set-url origin "${SPACE_REMOTE}" else git remote add origin "${SPACE_REMOTE}" fi echo "Pushing branch 'main' to ${SPACE_REMOTE}" echo "HF token as password: https://huggingface.co/settings/tokens" git push -u origin main