depth-anything-3 / sync_to_hf.sh
Roi Lev
Add remote development workflow scripts and enable Gradio reload
32cde13
#!/bin/bash
# Quick sync script to push changes to Hugging Face Space
# Usage: ./sync_to_hf.sh [commit message]
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# Get commit message from argument or use default
COMMIT_MSG="${1:-Update from local development}"
echo "πŸ”„ Syncing changes to Hugging Face Space..."
echo ""
# Check for uncommitted changes
if git diff --quiet && git diff --cached --quiet; then
echo "βœ… No changes to commit"
else
echo "πŸ“ Staging changes..."
git add -A
echo "πŸ’Ύ Committing changes..."
git commit -m "$COMMIT_MSG"
fi
# Check if we're ahead of remote
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse @{u} 2>/dev/null || echo "")
if [ -z "$REMOTE" ] || [ "$LOCAL" != "$REMOTE" ]; then
echo "πŸ“€ Pushing to remote..."
git push origin main
echo ""
echo "βœ… Changes pushed successfully!"
echo " The Space will rebuild automatically (may take 2-5 minutes)"
echo " Monitor: https://huggingface.co/spaces/roileveko/depth-anything-3"
else
echo "βœ… Already up to date with remote"
fi