Spaces:
Sleeping
Sleeping
A newer version of the Streamlit SDK is available:
1.54.0
π Quick Deployment Guide
π― Choose Your Deployment Method
π’ Option 1: Quick Demo (Recommended for Interviews)
Perfect for demonstrations and quick testing.
Windows:
# Double-click or run:
start_demo.bat
Linux/Mac:
./start_demo.sh
What it does:
- Starts backend on port 8001
- Starts frontend on port 8501
- Opens browser automatically
- Shows progress in separate windows
π‘ Option 2: Docker Deployment (Recommended for Production)
Professional containerized deployment.
Prerequisites:
- Install Docker Desktop
Windows:
# Double-click or run:
deploy_docker.bat
Linux/Mac:
./deploy_docker.sh
What it does:
- Builds Docker containers
- Sets up networking
- Provides health checks
- Includes nginx reverse proxy (optional)
π Check Deployment Status
Windows:
check_status.bat
Linux/Mac:
curl http://localhost:8001/ # Backend health
curl http://localhost:8501/ # Frontend health
π Access Your Application
Once deployed, access these URLs:
- π¨ Frontend UI: http://localhost:8501
- β‘ Backend API: http://localhost:8001
- π API Documentation: http://localhost:8001/docs
π Stop Services
Quick Demo:
- Windows: Run
stop_services.bator close command windows - Linux/Mac: Press
Ctrl+Cin terminal
Docker:
docker-compose down
π Troubleshooting
Common Issues:
Port already in use:
# Kill existing processes taskkill /f /im python.exe # Windows pkill -f python # Linux/MacModels not loading:
- Check if
models/indictrans2/directory exists - Ensure models were downloaded properly
- Check backend logs for errors
- Check if
Frontend can't connect to backend:
- Verify backend is running on port 8001
- Check
frontend/app.pyhas correct API_BASE_URL
Docker issues:
# Check Docker status docker ps docker-compose logs # Reset Docker docker-compose down docker system prune -f docker-compose up --build
π§ Configuration
Environment Variables:
Create .env file in root directory:
MODEL_TYPE=indictrans2
MODEL_PATH=models/indictrans2
DEVICE=cpu
DATABASE_PATH=data/translations.db
For Production:
- Copy
.env.productionto.env - Update database settings
- Configure CORS origins
- Set up monitoring
π Performance Tips
Use GPU if available:
DEVICE=cuda # in .env fileIncrease memory for Docker:
- Docker Desktop β Settings β Resources β Memory: 8GB+
Monitor resource usage:
docker stats # Docker containers htop # System resources
π Success Indicators
β Deployment Successful When:
- Backend responds at http://localhost:8001
- Frontend loads at http://localhost:8501
- Can translate "Hello" to Hindi
- API docs accessible at http://localhost:8001/docs
- No error messages in logs
π Need Help?
Check the logs:
- Quick Demo: Look at command windows
- Docker:
docker-compose logs -f
Verify prerequisites:
- Python 3.11+ installed
- All dependencies in requirements.txt
- Models downloaded in correct location
Test individual components:
- Backend:
curl http://localhost:8001/ - Frontend: Open browser to http://localhost:8501
- Backend:
π― For Interview Demos: Use Quick Demo option - it's fastest and shows everything working!