Spaces:
Sleeping
Sleeping
Commit
·
d133fb5
1
Parent(s):
db6b88a
Update app.py
Browse files
app.py
CHANGED
@@ -7,9 +7,9 @@ my_pipeline = pipeline('question-answering', model=mdl_name, tokenizer=mdl_name)
|
|
7 |
|
8 |
def answer_question(question,context):
|
9 |
text = '''{'question': {}, 'context': {} }'''.format(question, context)
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
|
14 |
grad.Interface(answer_question, inputs=["text","text"], outputs="text").launch()
|
15 |
Listing 5-1Code for app.py
|
|
|
7 |
|
8 |
def answer_question(question,context):
|
9 |
text = '''{'question': {}, 'context': {} }'''.format(question, context)
|
10 |
+
di=ast.literal_eval(text)
|
11 |
+
response = my_pipeline(di)
|
12 |
+
return response
|
13 |
|
14 |
grad.Interface(answer_question, inputs=["text","text"], outputs="text").launch()
|
15 |
Listing 5-1Code for app.py
|