gpt2 genre story generator
pranavpsvGPT2 Genre-Based Story Generator
Introduction
The GPT2 Genre-Based Story Generator is a fine-tuned version of the GPT2 model designed for generating stories based on user-specified genres and prompts. It supports a variety of genres, allowing for creative text generation tailored to specific themes.
Architecture
This model is based on the GPT2 architecture and has been fine-tuned to enhance its capability in generating genre-specific stories. It leverages the transformer-based architecture of GPT2 to understand and produce coherent narratives.
Training
The model was initialized with pre-trained weights from the original GPT2 checkpoint. It was then fine-tuned using a dataset composed of stories from various genres, allowing it to generate text that aligns with genre-specific characteristics.
Guide: Running Locally
To run the GPT2 Genre-Based Story Generator locally, follow these steps:
-
Install the
transformers
library if not already installed:pip install transformers
-
Use the following Python code to generate stories:
from transformers import pipeline story_gen = pipeline("text-generation", "pranavpsv/gpt2-genre-story-generator") print(story_gen("<BOS> <superhero> Batman"))
-
The model supports the following genres: superhero, action, drama, horror, thriller, and sci-fi. Use the format
<BOS> <genre> Some optional text...
to generate a story.
Suggested Cloud GPUs
For more efficient execution, especially for longer texts or larger batch sizes, consider using cloud GPU services such as AWS EC2 with GPU instances or Google Cloud Platform's AI Platform.
License
This project is available under the license specified on the Hugging Face model card page for the pranavpsv/gpt2-genre-story-generator
. Please refer to the page for specific licensing details.