Downloads · 30 days
9
20% of all-time downloads
kmcowan/rockymtn_gpt2
rockymtn_gpt2 is a machine learning model from kmcowan. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This is a GPT-2 model fine-tuned on novels and books of varying topics. It is designed to generate text based on the input prompt.
Downloads · 30 days
9
20% of all-time downloads
All-time downloads
45
Public
Parameters
124M
5.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.pth996 MB · 24%
From the Hugging Face model README
This is a GPT-2 model fine-tuned on novels and books of varying topics. It is designed to generate text based on the input prompt.
You can use this model with the transformers library:
from transformers import GPT2Tokenizer, GPT2LMHeadModel
tokenizer = GPT2Tokenizer.from_pretrained("kmcowan/rockymtn_gpt2")
model = GPT2LMHeadModel.from_pretrained("kmcowan/rockymtn_gpt2")
input_text = "The future of AI is"
input_ids = tokenizer.encode(input_text, return_tensors='pt')
outputs = model.generate(input_ids, max_length=50)
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(generated_text)