Downloads · 30 days
168
1% of all-time downloads
sadia72/gpt2-shakespeare
gpt2-shakespeare is a text generation model from sadia72. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
168
1% of all-time downloads
All-time downloads
29.1K
Public
Repo size
8.7 GB
Likes
5
Public
Click a slice to open those files.
.bin510 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of gpt2 on datasets containing Shakespeare Books. It achieves the following results on the evaluation set:
GPT-2 model is finetuned with text corpus.
Intended use for this model is to write novel in Shakespeare Style. It has limitations to write in other writer's style.
Text corpus is developed for fine-tuning gpt-2 model. Books are downloaded from Project Gutenberg as plain text files. A large text corpus were needed to train the model to be abled to write in Shakespeare style.
The following books are used to develop text corpus:
Corpus has total 1078389 word tokens.
Training dataset has 880447 word tokens and test dataset has 197913 word tokens.
To train the model, training api from Transformer class is used.
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| No log | 0.63 | 250 | 2.7133 |
| 2.8492 | 1.25 | 500 | 2.6239 |
| 2.8492 | 1.88 | 750 | 2.5851 |
| 2.3842 | 2.51 | 1000 | 2.5738 |
from transformers import pipeline
story = pipeline('text-generation',model='./gpt2-shakespeare', tokenizer='gpt2', max_length = 300)
story("how art thou")