# How to Push to HuggingFace ## The Issue Git push to HuggingFace isn't prompting for authentication because we're in a non-interactive environment. Here's how to authenticate properly: --- ## Solution: Use HuggingFace CLI to Login ### Step 1: Login with HuggingFace CLI Run this command in your terminal: ```bash huggingface-cli login ``` When prompted: - Enter your **new HuggingFace write token** (the one you created after revoking the old one) - The token should start with `hf_...` - Choose **Yes** when asked to add token as git credential This will: 1. Store your HuggingFace token securely 2. Configure git to use it for HuggingFace operations 3. Enable pushing to your HuggingFace Space ### Step 2: Push to HuggingFace After logging in, push your changes: ```bash cd /home/thadillo/MyProjects/participatory_planner git push hf feature/sentence-level-categorization:main ``` This should now work without prompting! --- ## Alternative: Manually Add HuggingFace Credential If the CLI login doesn't work, you can manually add the credential: ```bash # Add HuggingFace credential to git credentials file echo "https://thadillo:YOUR_NEW_HF_TOKEN@huggingface.co" >> ~/.git-credentials ``` Replace `YOUR_NEW_HF_TOKEN` with your actual HuggingFace token. Then push: ```bash git push hf feature/sentence-level-categorization:main ``` --- ## Alternative: Use Git with Token in URL (One-time) If you prefer a one-time push without storing credentials: ```bash cd /home/thadillo/MyProjects/participatory_planner # Push with token embedded (replace YOUR_TOKEN) git push https://thadillo:YOUR_NEW_HF_TOKEN@huggingface.co/spaces/thadillo/participatory-planner feature/sentence-level-categorization:main ``` **Warning**: This doesn't store the credential, so you'll need to do this every time. --- ## Verify the Push After pushing successfully, verify: 1. **Check HuggingFace Space**: https://huggingface.co/spaces/thadillo/participatory-planner 2. **Check Build Logs**: https://huggingface.co/spaces/thadillo/participatory-planner/logs 3. **Verify Files Updated**: The commit should show in the Space's Files tab --- ## What Happens Next Once pushed, HuggingFace will: 1. Automatically rebuild your Space 2. Apply all the security fixes 3. Fix the deployment errors (TRANSFORMERS_CACHE, matplotlib, SQLite) **Don't forget**: You still need to set the HuggingFace Spaces secrets (FLASK_SECRET_KEY and ADMIN_TOKEN) as described in SETUP_INSTRUCTIONS.md! --- ## Quick Commands Summary ```bash # Option 1: Login with HuggingFace CLI (recommended) huggingface-cli login git push hf feature/sentence-level-categorization:main # Option 2: Manual credential file edit echo "https://thadillo:YOUR_HF_TOKEN@huggingface.co" >> ~/.git-credentials git push hf feature/sentence-level-categorization:main # Option 3: One-time push with token git push https://thadillo:YOUR_HF_TOKEN@huggingface.co/spaces/thadillo/participatory-planner feature/sentence-level-categorization:main ``` --- ## Troubleshooting ### Error: "Authentication failed" - Double-check your HuggingFace token is correct - Ensure it's a **write** token (not read-only) - Verify the token hasn't expired ### Error: "could not read Username" - This means git isn't getting credentials properly - Use `huggingface-cli login` to fix this ### Error: "remote rejected" - Check you have write access to the Space - Verify the Space name is correct: `thadillo/participatory-planner` --- ## Current Status - ✅ All changes committed to git - ✅ Pushed to GitHub successfully - ⏳ **Waiting for you to push to HuggingFace** - ⏳ Waiting for HuggingFace Spaces secrets to be set Follow the steps above to complete the deployment!