Spaces:
Sleeping
Sleeping
| # Push VAMGUARD_TITAN to HuggingFace repository | |
| set -e | |
| echo "================================================" | |
| echo "π€ Pushing to HuggingFace: DJ-Goanna-Coding" | |
| echo "================================================" | |
| echo "" | |
| # Check if HF_TOKEN is set | |
| if [ -z "$HF_TOKEN" ]; then | |
| echo "β οΈ HF_TOKEN environment variable not set" | |
| echo " Please set your HuggingFace token:" | |
| echo " export HF_TOKEN='your_token_here'" | |
| exit 1 | |
| fi | |
| echo "β HF_TOKEN found" | |
| echo "" | |
| # Get repository info | |
| REPO_NAME="VAMGUARD_TITAN" | |
| HF_USERNAME="DJ-Goanna-Coding" | |
| HF_SPACE_NAME="TIA-ARCHITECT-CORE" | |
| echo "π Repository Information:" | |
| echo " GitHub Repo: DJ-Goana-Coding/$REPO_NAME" | |
| echo " HF Username: $HF_USERNAME" | |
| echo " HF Space: $HF_SPACE_NAME" | |
| echo "" | |
| # Check if we're in a git repository | |
| if [ ! -d .git ]; then | |
| echo "β Not in a git repository" | |
| exit 1 | |
| fi | |
| echo "β Git repository detected" | |
| echo "" | |
| # Add HuggingFace remote if it doesn't exist | |
| HF_REMOTE_URL="https://huggingface.co/spaces/$HF_USERNAME/$HF_SPACE_NAME" | |
| if git remote get-url huggingface 2>/dev/null; then | |
| echo "π‘ HuggingFace remote already exists" | |
| git remote set-url huggingface "$HF_REMOTE_URL" | |
| else | |
| echo "π‘ Adding HuggingFace remote" | |
| git remote add huggingface "$HF_REMOTE_URL" | |
| fi | |
| echo " Remote URL: $HF_REMOTE_URL" | |
| echo "" | |
| # Get current branch | |
| CURRENT_BRANCH=$(git branch --show-current) | |
| echo "πΏ Current branch: $CURRENT_BRANCH" | |
| echo "" | |
| # Show what will be pushed | |
| echo "π Files to be pushed:" | |
| git ls-files | head -20 | |
| echo " ... and more" | |
| echo "" | |
| # Confirm push | |
| read -p "π Push to HuggingFace? (y/N): " -n 1 -r | |
| echo "" | |
| if [[ ! $REPLY =~ ^[Yy]$ ]]; then | |
| echo "β Push cancelled" | |
| exit 0 | |
| fi | |
| echo "" | |
| echo "π Pushing to HuggingFace..." | |
| echo "" | |
| # Configure git to use token | |
| git config --local credential.helper store | |
| # Push to HuggingFace | |
| git push huggingface $CURRENT_BRANCH:main --force | |
| echo "" | |
| echo "================================================" | |
| echo "β Successfully pushed to HuggingFace!" | |
| echo "================================================" | |
| echo "" | |
| echo "π View your space at:" | |
| echo " https://huggingface.co/spaces/$HF_USERNAME/$HF_SPACE_NAME" | |
| echo "" | |
| echo "π Note: It may take a few minutes for HuggingFace to rebuild your space" | |
| echo "" | |