Song_recommendation / README.md
subhan971's picture
Update README.md
e0dc85e verified
---
Hindi Song Recommender App
This Streamlit application uses Google's Gemini AI to analyze uploaded images and recommend Hindi or Pakistani songs that resonate with the person in the image.
Features
Upload images or capture from camera
AI-powered analysis of images
Personalized Hindi/Pakistani song recommendations
Direct YouTube links to listen to recommended songs
Deployment on Hugging Face Spaces
Option 1: Docker-based Deployment (Recommended)
Go to Hugging Face Spaces
Click "Create new Space"
Select "Docker" as the SDK
Give your Space a name and set visibility (public/private)
Click "Create Space"
Upload all files including the Dockerfile
Hugging Face will build and deploy using the Docker configuration
Option 2: Standard Streamlit Deployment
Go to Hugging Face Spaces
Click "Create new Space"
Select "Streamlit" as the SDK
Give your Space a name and set visibility (public/private)
Click "Create Space"
Upload streamlit_app.py and requirements.txt
Run the setup script in the Space's terminal:
bash
chmod +x setup.sh
./setup.sh
Configure Secret Keys
To securely use the Gemini API key:
Go to your Space settings
Navigate to the "Variables and secrets" section
Add a new secret with:
Name: GEMINI_API_KEY
Value: Your actual Google Gemini API key
Troubleshooting Common Errors
If you encounter a "Permission denied: '/.streamlit'" error:
Use the Docker-based deployment (Option 1 above)
Or run the setup.sh script to create the directory with proper permissions
Local Development
Install dependencies:
pip install -r requirements.txt
Create a .streamlit/secrets.toml file with your API key:
toml
GEMINI_API_KEY = "your-api-key-here"
Run the app:
streamlit run streamlit_app.py
Troubleshooting
Permission Denied Error for .streamlit Directory
If you encounter this error:
PermissionError: [Errno 13] Permission denied: '/.streamlit'
Try one of these solutions:
Run the setup script: ./setup.sh
Manually create the directory: mkdir -p ~/.streamlit && chmod 777 ~/.streamlit
Use the Docker-based deployment method
Missing OpenCV Dependencies
If you encounter an error about missing libGL.so.1, it means OpenCV dependencies are missing. The app has been updated to not require OpenCV.
Important Notes
Make sure your Gemini API key has sufficient quota
For best results, use clear images with good lighting
The app handles temporary file storage for security
License
This project is available under the MIT License.