isimorfizam commited on
Commit
07765e8
·
verified ·
1 Parent(s): 9638e7c

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ pipeline = pipeline(task="feedback-distilbert", model="isimorfizam/distilbert-base-cased-distilled-squad-feedback")
5
+
6
+ def predict(question):
7
+ question_answerer = pipeline("question-answering", model=MODEL_CHECKPOINT)
8
+ return question_answerer(question=question,context=context)
9
+
10
+
11
+ gradio_app = gr.Interface(
12
+ predict,
13
+ inputs=str,
14
+ outputs=str,
15
+ title='QA',
16
+ )
17
+
18
+ if __name__ == "__main__":
19
+ gradio_app.launch()