#!/bin/bash # Quick deployment script for Hugging Face Spaces echo "🚀 Financial Research Agent - HF Spaces Deployment" echo "==================================================" echo "" # Check if username is provided if [ -z "$1" ]; then echo "Usage: ./QUICK_DEPLOY.sh YOUR_HF_USERNAME" echo "Example: ./QUICK_DEPLOY.sh sanchitsharma10" exit 1 fi HF_USERNAME=$1 SPACE_NAME="financial-research-agent" echo "📝 Configuration:" echo " Username: $HF_USERNAME" echo " Space: $SPACE_NAME" echo "" # Check if git is initialized if [ ! -d .git ]; then echo "📦 Initializing git repository..." git init fi # Create deployment branch echo "🌿 Creating deployment branch..." git checkout -b hf-deploy 2>/dev/null || git checkout hf-deploy # Prepare HF-specific files echo "📋 Preparing Hugging Face files..." cp README_HF.md README.md cp requirements-hf.txt requirements.txt # Add files echo "➕ Adding files to git..." git add app.py README.md requirements.txt src/ .gitattributes .env.hf # Commit echo "💾 Committing changes..." git commit -m "Deploy to Hugging Face Spaces" || echo "No changes to commit" # Add HF remote echo "🔗 Adding Hugging Face remote..." git remote remove hf 2>/dev/null git remote add hf https://huggingface.co/spaces/$HF_USERNAME/$SPACE_NAME echo "" echo "✅ Ready to push!" echo "" echo "⚠️ IMPORTANT: Before pushing, make sure you:" echo " 1. Created the Space on Hugging Face" echo " 2. Set it to SDK: Gradio" echo " 3. Have your HF token ready for authentication" echo "" echo "To push, run:" echo " git push hf hf-deploy:main" echo "" echo "After pushing, configure secrets in HF Spaces Settings:" echo " - SEC_EMAIL=your@email.com" echo " - NEWS_API_KEY=your_key" echo "" echo "Your Space will be live at:" echo " https://huggingface.co/spaces/$HF_USERNAME/$SPACE_NAME" echo ""