Spaces:
Runtime error
Runtime error
Brian Watson
commited on
Commit
β’
96ad10f
1
Parent(s):
df19b76
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ nlp = pipeline('text-generation', model=model, tokenizer=tokenizer)
|
|
10 |
|
11 |
def generate(prompt):
|
12 |
output = ''
|
13 |
-
outs = nlp(prompt, max_length=76, num_return_sequences=
|
14 |
for i in range(len(outs)):
|
15 |
generated_text = str(outs[i]['generated_text']).replace(' ', '').rstrip(',')
|
16 |
output += generated_text
|
|
|
10 |
|
11 |
def generate(prompt):
|
12 |
output = ''
|
13 |
+
outs = nlp(prompt, max_length=76, num_return_sequences=1, do_sample=True, repetition_penalty=1.2, temperature=0.7, top_k=3, early_stopping=True)
|
14 |
for i in range(len(outs)):
|
15 |
generated_text = str(outs[i]['generated_text']).replace(' ', '').rstrip(',')
|
16 |
output += generated_text
|