π΅ AI Lyrics Generator
This model generates song lyrics based on prompts. It's a fine-tuned version of GPT-2 trained on a diverse dataset of song lyrics.
Model Description
- Base Model: GPT-2
- Task: Lyrics Generation
- Training Data: Custom dataset of 10,000+ songs from various genres
- Languages: English
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
# Load model
tokenizer = AutoTokenizer.from_pretrained("bcash2233/lyrics-generator-gpt2")
model = AutoModelForCausalLM.from_pretrained("bcash2233/lyrics-generator-gpt2")
# Generate lyrics
prompt = "Write lyrics for a rock song about freedom"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(
inputs.input_ids,
max_length=300,
temperature=0.8,
top_p=0.9,
do_sample=True
)
lyrics = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(lyrics)
Streamlit Demo
Try the interactive web app:
streamlit run app.py
Training Details
- Epochs: 3
- Batch Size: 4
- Learning Rate: 5e-5
- Training Time: ~2 hours (GPU)
Example Outputs
Prompt: "Write lyrics for a sad ballad about heartbreak"
Output:
I'm standing in the rain again
Thinking 'bout the way we were
Every memory cuts like glass
And I can't seem to let you go...
Limitations
- May generate repetitive phrases
- Best with clear, specific prompts
- Quality varies by prompt complexity
Citation
@misc{lyrics-generator-gpt2,
author = {Your Name},
title = {AI Lyrics Generator},
year = {2024},
publisher = {Hugging Face},
url = {https://huggingface.co/bcash2233/lyrics-generator-gpt2}
}
License
MIT License
- Downloads last month
- 27