alexvaroz commited on
Commit
319ff26
1 Parent(s): 9f9438c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -3,9 +3,13 @@ import gradio as grad
3
  import ast
4
  mdl_name = "deepset/roberta-base-squad2"
5
  my_pipeline = pipeline('question-answering', model=mdl_name, tokenizer=mdl_name)
 
 
6
  def answer_question(question,context):
7
-     text= "{"+"'question': '"+question+"','context': '"+context+"'}"
8
-     di=ast.literal_eval(text)
9
-     response = my_pipeline(di)
10
-     return response
 
 
11
  grad.Interface(answer_question, inputs=["text","text"], outputs="text").launch()
 
3
  import ast
4
  mdl_name = "deepset/roberta-base-squad2"
5
  my_pipeline = pipeline('question-answering', model=mdl_name, tokenizer=mdl_name)
6
+
7
+
8
  def answer_question(question,context):
9
+ text = "{"+"'question': '"+question+"','context': '"+context+"'}"
10
+ di = ast.literal_eval(text)
11
+ response = my_pipeline(di)
12
+ return response
13
+
14
+
15
  grad.Interface(answer_question, inputs=["text","text"], outputs="text").launch()