Downloads · 30 days
0
SpartanCinder/GPT2-finetuned-lyric-generation
GPT2-finetuned-lyric-generation is a machine learning model from SpartanCinder. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for adapter-transformers. The card lists the license as cc.
This repository contains a pretrained GPT2 model fine-tuned for lyric generation. The model was trained using the Hugging Face's Transformers library.
Downloads · 30 days
0
Access
Public
Updated Apr 22, 2024
Parameters
124M
498 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors498 MB · 99%
From the Hugging Face model README
This repository contains a pretrained GPT2 model fine-tuned for lyric generation. The model was trained using the Hugging Face's Transformers library.
The model can be used to generate lyrics. It uses nucleus sampling with a probability threshold of 0.9 for generating the lyrics, which helps in generating more diverse and less repetitive text.
Here is a basic usage example:
from transformers import GPT2LMHeadModel, GPT2Tokenizer
tokenizer = GPT2Tokenizer.from_pretrained("SpartanCinder/GPT2-pretrained-lyric-generation")
model = GPT2LMHeadModel.from_pretrained("SpartanCinder/GPT2-pretrained-lyric-generation")
input_ids = tokenizer.encode("Once upon a time", return_tensors='pt')
output = model.generate(input_ids, max_length=100, num_return_sequences=5, do_sample=True, top_p=0.9)
print(tokenizer.decode(output[0], skip_special_tokens=True))