smgriffin's picture
Update README.md
b335913 verified
metadata
library_name: transformers
tags:
  - music
  - lyrics
  - generation
datasets:
  - smgriffin/24thankyou-lyrics
language:
  - en
base_model:
  - openai-community/gpt2
pipeline_tag: text-generation

Model Card for Model ID

Midwest indie band 24thankyou lyrics generator, finetuned from gpt2.

How to Use

You can use the following code to generate lyrics:


from transformers import GPT2LMHeadModel, GPT2Tokenizer, pipeline

# load model
model_name = "smgriffin/24thankyou-lyrics-generator"
model = GPT2LMHeadModel.from_pretrained(model_name)
tokenizer = GPT2Tokenizer.from_pretrained(model_name)

# create text generation pipeline
text_generator = pipeline("text-generation", model=model, tokenizer=tokenizer)

# prompt for lyrics
prompt = f"Lyrics:"

# generate and print
generated_texts = text_generator(
    prompt, 
    max_length=150,
    num_return_sequences=1,  
    temperature=0.9,
    top_k=50,
    top_p=0.95,
    do_sample=True, 
)

print("Generated Lyrics:")
print(generated_texts[0]["generated_text"])