Spaces:
Sleeping
Sleeping
π Deployment Guide - Using HuggingFace Models
β Perfect Setup!
You've uploaded your models to HuggingFace at: anis80/anisproject
The app is now configured to download models from there automatically!
π€ Deploy to Render (Recommended - Free)
Step 1: Push to GitHub
cd e:\anis
# Add GitHub remote (replace YOUR_USERNAME)
git remote add origin https://github.com/YOUR_USERNAME/sentiment-analysis-backend.git
git branch -M main
# Push to GitHub
git push -u origin main
Step 2: Deploy to Render
- Go to: https://render.com
- Sign up with GitHub
- Create "New Web Service"
- Connect your
sentiment-analysis-backendrepository - Configure:
- Name:
sentiment-analysis-api - Runtime:
Python 3 - Build Command:
pip install -r requirements.txt - Start Command:
uvicorn app:app --host 0.0.0.0 --port $PORT - Instance Type: Free
- Name:
- Click "Create Web Service"
Step 3: Wait for Deployment (3-5 minutes)
Your API will be live at: https://sentiment-analysis-api-XXXX.onrender.com
π Alternative: Deploy to HuggingFace Spaces
Since your models are already on HuggingFace, you can also deploy there:
Create Space
- Go to: https://huggingface.co/new-space
- Name:
sentiment-analysis-api - SDK: Docker
- Hardware: CPU basic (Free)
Push Code
cd e:\anis
# Add HuggingFace remote
git remote add hf https://huggingface.co/spaces/anis80/sentiment-analysis-api
git push hf main
β Benefits of This Approach
- β No large files in repository (only ~10KB of code)
- β Models downloaded on startup from HuggingFace
- β Works on any platform (Render, HuggingFace, Railway, etc.)
- β Easy model updates - just update on HuggingFace
- β Free deployment on both platforms
π§ͺ Test Locally First
cd e:\anis
pip install -r requirements.txt
python app.py
Visit: http://localhost:7860/docs
π Update Frontend
Once deployed, update index.html lines 72-73:
const predictApi = 'https://YOUR_DEPLOYMENT_URL/predict';
const statusApi = 'https://YOUR_DEPLOYMENT_URL/status';
Then deploy frontend to Vercel!
π° Cost: $0/month π
Both Render and HuggingFace offer free tiers perfect for this project!
Ready to deploy? Choose Render or HuggingFace and follow the steps above! π