#!/bin/bash # Fix Git LFS Authentication for Hugging Face Space echo "🔐 Setting up Hugging Face Git Authentication" echo "" echo "You have 3 options to fix the Git LFS authentication error:" echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "Option 1: Use Hugging Face Token in URL (Quick Fix)" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" echo "1. Get your HF token from: https://huggingface.co/settings/tokens" echo "2. Run this command:" echo "" echo " git remote set-url origin https://YOUR_USERNAME:YOUR_TOKEN@huggingface.co/spaces/SammyLim/VideoMaMa" echo "" echo " Replace YOUR_USERNAME with your HF username" echo " Replace YOUR_TOKEN with your HF token" echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "Option 2: Use Git Credential Helper (Recommended)" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" echo "1. Install huggingface-cli:" echo " pip install huggingface-hub" echo "" echo "2. Login to Hugging Face:" echo " huggingface-cli login" echo "" echo "3. Configure git to use HF credentials:" echo " git config --global credential.helper store" echo "" echo "4. Then push again:" echo " git push" echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "Option 3: Don't Push Large Files (Alternative)" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" echo "If you don't want to push the sam2.1_hiera_large.pt file:" echo "" echo "1. Add it to .gitignore:" echo " echo 'sam2.1_hiera_large.pt' >> .gitignore" echo "" echo "2. Remove from Git LFS tracking (if needed):" echo " git rm --cached sam2.1_hiera_large.pt" echo "" echo "3. Update your download_checkpoints.sh to download it on Space startup" echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" echo "⚠️ Current Status:" echo " - Git is trying to push LFS file via commit: dc30125" echo " - File deleted but still in Git history" echo " - LFS needs authentication to push" echo "" echo "💡 Recommendation:" echo " Use Option 2 (credential helper) for best security and convenience" echo ""