Spaces:
Sleeping
Sleeping
# Quick deployment script for ScholarShare to Hugging Face Spaces | |
# Make sure to replace YOUR_USERNAME and YOUR_SPACE_NAME with your actual values | |
echo "π Quick Deployment to Hugging Face Spaces" | |
echo "===========================================" | |
# Check if we're in the deployment_temp directory | |
if [[ ! -d "app" || ! -f "app.py" ]]; then | |
echo "β Please run this from the deployment_temp directory" | |
echo "First run: cd deployment_temp" | |
exit 1 | |
fi | |
# Initialize git if not already done | |
if [[ ! -d ".git" ]]; then | |
echo "π¦ Initializing git repository..." | |
git init | |
git branch -M main | |
fi | |
# Add all files | |
echo "π Adding files to git..." | |
git add . | |
# Commit | |
echo "πΎ Creating initial commit..." | |
git commit -m "Initial ScholarShare deployment to HF Spaces" | |
# Prompt for HF Space URL | |
echo "" | |
echo "π Please provide your Hugging Face Space URL:" | |
echo "Example: https://huggingface.co/spaces/yourusername/scholarshare" | |
read "space_url?Enter your HF Space URL: " | |
if [[ -z "$space_url" ]]; then | |
echo "β No URL provided. Please run the script again with your HF Space URL." | |
exit 1 | |
fi | |
# Add remote | |
echo "π Adding Hugging Face remote..." | |
git remote add origin "$space_url" | |
# Push to HF Spaces | |
echo "π Deploying to Hugging Face Spaces..." | |
git push -u origin main | |
echo "" | |
echo "β Deployment completed!" | |
echo "" | |
echo "π IMPORTANT: Don't forget to set your API keys in HF Spaces:" | |
echo " 1. Go to your Space on HuggingFace" | |
echo " 2. Click 'Settings' tab" | |
echo " 3. Scroll to 'Repository secrets'" | |
echo " 4. Add these secrets:" | |
echo " - OPENAI_API_KEY" | |
echo " - ANTHROPIC_API_KEY (optional)" | |
echo " - MISTRAL_API_KEY (optional)" | |
echo " - DEVTO_API_KEY (optional)" | |
echo "" | |
echo "π Your app should be live at: $space_url" | |