🚀 GPT-Neo for Fiction Story Generation
This model is a fine - tuned version of EleutherAI's GPT - Neo - 125M model, optimized for generating fictional stories. It was trained on a dataset available at https://github.com/facebookresearch/fairseq/tree/main/examples/stories.
✨ Features
Model Description
Property |
Details |
Model Name |
GPT - Neo - Fiction |
Student |
Tin Kanjovsky/Tincando |
Mentor |
izv.prof.dr.sc. Darko Etinger |
Model Version |
1.0 |
Use Cases and Limitations
The model is designed for generating creative fictional stories. It can be used for various purposes, including but not limited to:
- Storytelling: Generating interesting and imaginative fictional stories.
- Content Generation: Creating content for blogs, websites, or other media with a storytelling element.
- Creative Writing: Assisting authors and writers in brainstorming ideas and developing narratives.
Model Performance
- Training Data: The model was trained on a diverse dataset of fictional stories and prompts.
- Evaluation Metrics: Performance metrics such as perplexity or BLEU scores may vary depending on the specific task and dataset.
Limitations
⚠️ Important Note
- Content Quality: Although the model can generate creative stories, the quality and coherence of the output may vary, and it may occasionally produce nonsensical or inappropriate content.
- Bias: The model may exhibit biases present in the training dataset, so it is important to be cautious when using it for sensitive topics or content.
- Output Length: The model can generate text of different lengths and may not always produce the desired output length.
- Fine - Tuning Data: The quality of the generated stories depends on the quality and diversity of the fine - tuning dataset.
📦 Installation
No installation steps are provided in the original document, so this section is skipped.
💻 Usage Examples
Basic Usage
from transformers import GPTNeoForCausalLM, GPT2Tokenizer
tokenizer = GPT2Tokenizer.from_pretrained(Tincando/fiction_story_generator)
model = GPTNeoForCausalLM.from_pretrained(Tincando/fiction_story_generator)
input_prompt = "[WP] I can't believe I died the same way twice."
input_ids = tokenizer(input_prompt, add_special_tokens=False, return_tensors="pt").input_ids
output = model.generate(input_ids,
max_length=300,
temperature=0.9,
top_k=2,
top_p=0.9,
repetition_penalty=1.2,
do_sample=True,
num_return_sequences=2
)
generated_story = tokenizer.batch_decode(output,clean_up_tokenization_spaces=True)[0]
print(generated_story)
📚 Documentation
Ethics
When using this model, consider the following ethical guidelines:
💡 Usage Tip
- Content Moderation: Implement content moderation to ensure that the generated stories do not violate community guidelines or standards.
- Bias and Fairness: Be aware of potential biases in the model's output and take steps to mitigate them.
- Privacy: Avoid using personal or sensitive information as input prompts.
- Legal Compliance: Ensure that the generated content complies with copyright laws and intellectual property rights.
Citation
If you use GPT - Neo - Fiction in your work, please consider citing the original GPT - Neo model and the dataset used for fine - tuning:
Training Hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e - 05
- train_batch_size: 8
- eval_batch_size: 8
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon = 1e - 08
- lr_scheduler_type: linear
- num_epochs: 5
Training Results
Training Loss |
Epoch |
Step |
Validation Loss |
3.0842 |
1.0 |
34075 |
3.1408 |
3.0026 |
2.0 |
68150 |
3.1275 |
2.9344 |
3.0 |
102225 |
3.1270 |
2.8932 |
4.0 |
136300 |
3.1306 |
2.8517 |
5.0 |
170375 |
3.1357 |
Framework Versions
- Transformers 4.28.0
- Pytorch 1.12.1+cu116
- Datasets 2.4.0
- Tokenizers 0.12.1