osanseviero commited on
Commit
c6144cf
1 Parent(s): 8035b1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -1,8 +1,13 @@
1
  import os
2
  import gradio as gr
3
  import numpy as np
 
4
 
 
5
 
6
- io = gr.Interface.load("ybelkada/flan-t5-large", api_key=os.environ.get('api_key', None))
 
 
7
 
 
8
  io.launch()
 
1
  import os
2
  import gradio as gr
3
  import numpy as np
4
+ from transformers import pipeline
5
 
6
+ pipe = pipeline("text2text-generation", model="google/flan-t5-large")
7
 
8
+ def inference(text):
9
+ output = pipe(text)
10
+ return output["generated_text"]
11
 
12
+ io = gr.Interface.load(inference, gr.Textbox(lines=3), gr.Textbox(lines=3))
13
  io.launch()