Update README.md
Browse files
README.md
CHANGED
@@ -13,13 +13,13 @@ Gpt-2 for short story generation with genres.
|
|
13 |
## Model description
|
14 |
|
15 |
Gpt-2 model fine-tuned on sample of BookCorpus dataset for short story generation, allows for the following genres (tokens to use as input under parenthesis):
|
16 |
-
- Romance (
|
17 |
-
- Adventure (
|
18 |
-
- Mystery & detective (
|
19 |
-
- Fantasy (
|
20 |
-
- Humor & comedy (
|
21 |
-
- Paranormal (
|
22 |
-
- Science fiction (
|
23 |
|
24 |
Heavily inspired by https://huggingface.co/pranavpsv
|
25 |
## Intended uses & limitations
|
@@ -34,7 +34,7 @@ This can be used for text generation.
|
|
34 |
>>> model = GPT2LMHeadModel.from_pretrained(model_name)
|
35 |
>>> tokenizer = AutoTokenizer.from_pretrained(model_name)
|
36 |
>>> story_generator = TextGenerationPipeline(model=model, tokenizer=tokenizer)
|
37 |
-
#
|
38 |
>>> input_prompt = "<BOS> <adventure> He was trapped in the pirate's house"
|
39 |
>>> story = story_generator(input_prompt, max_length=80, do_sample=True,
|
40 |
repetition_penalty=1.5, temperature=1.2,
|
|
|
13 |
## Model description
|
14 |
|
15 |
Gpt-2 model fine-tuned on sample of BookCorpus dataset for short story generation, allows for the following genres (tokens to use as input under parenthesis):
|
16 |
+
- Romance (romance)
|
17 |
+
- Adventure (adventure)
|
18 |
+
- Mystery & detective (mystery-&-detective)
|
19 |
+
- Fantasy (fantasy)
|
20 |
+
- Humor & comedy (humor-&-comedy)
|
21 |
+
- Paranormal (paranormal)
|
22 |
+
- Science fiction (science-fiction)
|
23 |
|
24 |
Heavily inspired by https://huggingface.co/pranavpsv
|
25 |
## Intended uses & limitations
|
|
|
34 |
>>> model = GPT2LMHeadModel.from_pretrained(model_name)
|
35 |
>>> tokenizer = AutoTokenizer.from_pretrained(model_name)
|
36 |
>>> story_generator = TextGenerationPipeline(model=model, tokenizer=tokenizer)
|
37 |
+
# Input should be of format "<BOS> <Genre token> Optional starter text"
|
38 |
>>> input_prompt = "<BOS> <adventure> He was trapped in the pirate's house"
|
39 |
>>> story = story_generator(input_prompt, max_length=80, do_sample=True,
|
40 |
repetition_penalty=1.5, temperature=1.2,
|