akhooli commited on
Commit
f2b319f
1 Parent(s): af9ad6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -30,7 +30,9 @@ notes = """
30
  - Note/Disclaimer: may generate unaccepted or inappropriate content. Use at your own risk.
31
  """
32
  def sayPoetry(prompt, temp=1.0, topk = 50, topp = 1.0, penalty=1.0):
33
- gen = pipe(prompt, max_length=96, do_sample=True, temperature=temp, top_k=topk, top_p=topp, repetition_penalty=penalty)[0]["generated_text"]
 
 
34
  poetry =""
35
  for line in gen.split('.')[:-1]:
36
  poetry += line #+ "\n"
 
30
  - Note/Disclaimer: may generate unaccepted or inappropriate content. Use at your own risk.
31
  """
32
  def sayPoetry(prompt, temp=1.0, topk = 50, topp = 1.0, penalty=1.0):
33
+ gen = pipe(prompt, max_length=96, do_sample=True, temperature=temp, top_k=topk, top_p=topp, repetition_penalty=penalty,
34
+ min_length = 64, no_repeat_ngram_size = 3, return_full_text=True,
35
+ num_beams=5, num_return_sequences=1)[0]["generated_text"]
36
  poetry =""
37
  for line in gen.split('.')[:-1]:
38
  poetry += line #+ "\n"