financial-research-agent / QUICK_DEPLOY.sh
Sanchit7's picture
$(cat <<EOF
9e76be1
#!/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 " - [email protected]"
echo " - NEWS_API_KEY=your_key"
echo ""
echo "Your Space will be live at:"
echo " https://huggingface.co/spaces/$HF_USERNAME/$SPACE_NAME"
echo ""