Commit
·
23aa67b
1
Parent(s):
0cdb2ad
Update initial prompt + handling of >
Browse files
app.py
CHANGED
@@ -9,8 +9,12 @@ from happytransformer import GENSettings
|
|
9 |
def generate(text, length=100, penalty=3, temperature=0.8, topk=40):
|
10 |
args_top_k = GENSettings(no_repeat_ngram_size=penalty, do_sample=True, top_k=topk, temperature=temperature, max_length=length, early_stopping=True)
|
11 |
|
12 |
-
inputText = "Write a greentext from 4chan.org. The story should be like a bullet-point list using > as the start of each line.
|
13 |
-
|
|
|
|
|
|
|
|
|
14 |
|
15 |
print(inputText)
|
16 |
|
|
|
9 |
def generate(text, length=100, penalty=3, temperature=0.8, topk=40):
|
10 |
args_top_k = GENSettings(no_repeat_ngram_size=penalty, do_sample=True, top_k=topk, temperature=temperature, max_length=length, early_stopping=True)
|
11 |
|
12 |
+
inputText = "Write a greentext from 4chan.org. The story should be like a bullet-point list using > as the start of each line. Most greentexts are humorous or absurd in nature. Most greentexts have a twist near the end.\n"
|
13 |
+
|
14 |
+
if not text[0] == ">":
|
15 |
+
inputText += ">" + text + "\n>"
|
16 |
+
else:
|
17 |
+
inputText += text + "\n>"
|
18 |
|
19 |
print(inputText)
|
20 |
|