philipp-zettl commited on
Commit
c7085c3
·
verified ·
1 Parent(s): c002e83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -1,3 +1,13 @@
1
  import gradio as gr
 
 
2
 
3
- gr.load("models/philipp-zettl/t5-small-long-qa").launch()
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ # Use a pipeline as a high-level helper
3
+ from transformers import pipeline
4
 
5
+ pipe = pipeline("text2text-generation", model="philipp-zettl/t5-small-long-qa")
6
+
7
+
8
+ def generate(context, question):
9
+ prompt = f"question: {question} context: {context}"
10
+ return pipe(prompt)
11
+
12
+ demo = gr.Interface(fn=greet, inputs=[gr.Text('context'),gr.Text('question')], outputs="text")
13
+ demo.launch()