azaninello commited on
Commit
a18a223
1 Parent(s): be63c93

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -2,10 +2,10 @@ import gradio as gr
2
  import transformers
3
  from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
4
 
5
- shroom_generator = pipeline("text-generation", model=AutoModelForCausalLM.from_pretrained('LorenzoDeMattei/GePpeTto'), tokenizer="gpt2")
6
 
7
  def generator(inizia_la_storia = ''):
8
- shroom_result = shroom_generator(inizia_la_storia, max_length=420)
9
  return shroom_result[0]["generated_text"]
10
 
11
  iface = gr.Interface(fn=generator, inputs="text", outputs="text")
 
2
  import transformers
3
  from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
4
 
5
+ shroom_generator = pipeline("text-generation", model=AutoModelForCausalLM.from_pretrained('LorenzoDeMattei/GePpeTto'), tokenizer='LorenzoDeMattei/GePpeTto')
6
 
7
  def generator(inizia_la_storia = ''):
8
+ shroom_result = shroom_generator(inizia_la_storia, max_length=120)
9
  return shroom_result[0]["generated_text"]
10
 
11
  iface = gr.Interface(fn=generator, inputs="text", outputs="text")