Downloads · 30 days
2
5% of all-time downloads
yashu16/phrase-to-story-generator-v3
phrase-to-story-generator-v3 is a machine learning model from yashu16. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This directory contains the fine-tuned GPT-2 model for phrase-to-story generation.
Downloads · 30 days
2
5% of all-time downloads
All-time downloads
37
Public
Parameters
124M
498 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors498 MB · 100%
From the Hugging Face model README
This directory contains the fine-tuned GPT-2 model for phrase-to-story generation.
config.jsonmodel.safetensorstokenizer_config.jsonvocab.jsonmerges.txtspecial_tokens_map.jsongeneration_config.jsontraining_args.binmodel_info.jsonfrom transformers import GPT2LMHeadModel, GPT2Tokenizer
# Load model
tokenizer = GPT2Tokenizer.from_pretrained("./model")
model = GPT2LMHeadModel.from_pretrained("./model")
# Generate story
phrase = "magical forest"
prompt = f"Story prompt: {phrase}\n\nStory:"
inputs = tokenizer.encode(prompt, return_tensors="pt")
outputs = model.generate(inputs, max_length=200, temperature=0.8, do_sample=True)
story = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(story.split("Story:")[-1].strip())
This model is used by the Streamlit application in this repository. The updated_cloud_pipeline.py loads this model for local inference.
Total size: 476.21 MB