Skip to content

abbas-rz/Weeknd-GPT

Repository files navigation

The Weeknd Lyric GPT 🎤

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.


🚀 Features

✅ 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.


📂 Project Structure

  • 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

🔥 Setup Instructions

1️⃣ Clone the Repository

  • Clone the repository and navigate into the project folder.

2️⃣ Install Required Packages

  • 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

4️⃣ Generate Lyrics via CLI

  • Launch the CLI interface:
    • python infer.py
  • Type your lyric prompt and hit enter.
  • Type "exit" to quit.

🎤 How It Works

RAG (Retrieval-Augmented Generation)

The model uses FAISS to retrieve the most relevant lyrics and injects them into the prompt for contextual generation.

Lyric Generation

GPT-2 with LoRA generates lyrics fine-tuned to The Weeknd’s style.


⚡️ Configuration

🎛️ Model/Training Settings

Modify these parameters in train.py:

  • model_name: gpt2
  • epochs: 3
  • lr: 5e-5
  • batch_size: 8

🔥 Generation Settings

Tune generation parameters in infer.py:

  • top_k: 50
  • top_p: 0.9
  • temperature: 0.7
  • repetition_penalty: 1.2

🛠️ Troubleshooting

Repeating Prompts?

Adjust repetition_penalty to discourage repetitive outputs.

CUDA Errors?

Ensure your GPU is being utilized by running:

  • nvidia-smi

Memory Issues?

  • Reduce batch_size in train.py.
  • Use CPU if GPU memory is insufficient.

🤖 Future Enhancements

  • Add fine-tuning for different album styles.
  • Export generated lyrics to a text file.
  • API wrapper for web-based use.

🤝 Contributing

Feel free to open issues or submit pull requests to improve the project.


🎁 License

This project is licensed under the MIT License.


🦇 Created by Abbas (4bbvs)

Inspired by the dark vibes of The Weeknd and powered by GPT-2. 🎙️


About

Generate lyrics inspired by The Weeknd

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages