--- title: Music Genre Classifier & Lyrics Generator emoji: 🎵 colorFrom: indigo colorTo: purple sdk: gradio sdk_version: 5.22.0 app_file: app.py pinned: false license: mit short_description: AI music genre detection and lyrics generation --- # Music Genre Classifier & Lyrics Generator This Hugging Face Space application provides two AI-powered features: 1. **Music Genre Classification**: Upload a music file and get an analysis of its genre using the [dima806/music_genres_classification](https://huggingface.co/dima806/music_genres_classification) model. 2. **Lyrics Generation**: Based on the detected genre, the app generates original lyrics using [Llama-3.1-8B-Instruct](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct) that match both the style of the genre and approximate length of the song. ## Features - Upload any music file for instant genre classification - Receive genre predictions with confidence scores - Get AI-generated lyrics tailored to the detected music genre - Lyrics length is automatically adjusted based on the song duration - Simple and intuitive user interface ## Usage 1. Visit the live application on Hugging Face Spaces 2. Upload your music file using the provided interface 3. Click "Analyze & Generate" to process the audio 4. View the detected genre and generated lyrics in the output panels ## Technical Details - Uses MFCC features extraction from audio for genre classification - Leverages 4-bit quantization for efficient LLM inference on T4 GPU - Implements a specialized prompt engineering approach to generate genre-specific lyrics - Automatically scales lyrics length based on audio duration ## Links - [Music Genre Classification Model](https://huggingface.co/dima806/music_genres_classification) - [Llama 3.1 8B Instruct Model](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct)