Generate lyrics inspired by The Weeknd effortlessly! This project fine-tunes a GPT-2 model with a large corpus of The Weeknd’s lyrics and lets you interact with it through a slick console interface or an optional GUI.
✅ Fine-tuned GPT-2 on The Weeknd’s lyrics using LoRA.
✅ FAISS-powered retrieval to enhance lyric context.
✅ Clean and responsive CLI interaction.
✅ Optional GUI interface using Tkinter.
- Weeknd-Lyric-GPT
- lyrics.txt – Corpus of The Weeknd lyrics
- train.py – Fine-tuning and RAG training script
- infer.py – CLI interaction with the trained model
- saved_model/ – Fine-tuned model directory
- lyrics_index.faiss – FAISS index for lyric retrieval
- lyrics_list.txt – List of indexed lyrics for RAG
- Clone the repository and navigate into the project folder.
- activate venv:
./.venv/scripts/activate
3️⃣ Train/Fine-Tune the Model (YOU DONT HAVE TO DO THIS UNLESS YOU MODIFY THE CORPUS OR TRAINING CODE)
- Run the training script:
python train.py
- Launch the CLI interface:
- python infer.py
- Type your lyric prompt and hit enter.
- Type "exit" to quit.
The model uses FAISS to retrieve the most relevant lyrics and injects them into the prompt for contextual generation.
GPT-2 with LoRA generates lyrics fine-tuned to The Weeknd’s style.
Modify these parameters in train.py:
- model_name: gpt2
- epochs: 3
- lr: 5e-5
- batch_size: 8
Tune generation parameters in infer.py:
- top_k: 50
- top_p: 0.9
- temperature: 0.7
- repetition_penalty: 1.2
Adjust repetition_penalty to discourage repetitive outputs.
Ensure your GPU is being utilized by running:
nvidia-smi
- Reduce batch_size in train.py.
- Use CPU if GPU memory is insufficient.
- Add fine-tuning for different album styles.
- Export generated lyrics to a text file.
- API wrapper for web-based use.
Feel free to open issues or submit pull requests to improve the project.
This project is licensed under the MIT License.
Inspired by the dark vibes of The Weeknd and powered by GPT-2. 🎙️