azaninello commited on
Commit
0125db6
1 Parent(s): 70b313e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -11,13 +11,13 @@ tokenizer = GPT2Tokenizer.from_pretrained(
11
  shroom_generator = pipeline("text-generation", model=AutoModelWithLMHead.from_pretrained('LorenzoDeMattei/GePpeTto'),
12
  tokenizer='LorenzoDeMattei/GePpeTto',
13
  do_sample=True,
14
- max_length=100,
15
  top_k=50,
16
  top_p=0.95,
17
  repetition_penalty=9.5)
18
 
19
  def generator(inizia_la_storia = ''):
20
- shroom_result = shroom_generator(inizia_la_storia, max_length=420)
21
  return shroom_result[0]["generated_text"]
22
 
23
  iface = gr.Interface(fn=generator, inputs="text", outputs="text")
 
11
  shroom_generator = pipeline("text-generation", model=AutoModelWithLMHead.from_pretrained('LorenzoDeMattei/GePpeTto'),
12
  tokenizer='LorenzoDeMattei/GePpeTto',
13
  do_sample=True,
14
+ max_length=120,
15
  top_k=50,
16
  top_p=0.95,
17
  repetition_penalty=9.5)
18
 
19
  def generator(inizia_la_storia = ''):
20
+ shroom_result = shroom_generator(inizia_la_storia, max_length=120)
21
  return shroom_result[0]["generated_text"]
22
 
23
  iface = gr.Interface(fn=generator, inputs="text", outputs="text")