Spaces:
Runtime error
Runtime error
Commit ·
bf6b329
1
Parent(s): 0cf9321
Update app.py
Browse files
app.py
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def question_answer(context, question):
|
| 2 |
+
predictions, raw_outputs = este_si_me_sirvio.predict([{"context": context, "qas": [{"question": question, "id": "0",}],}])
|
| 3 |
+
prediccion = predictions[0]['answer'][0]
|
| 4 |
+
return prediccion
|
| 5 |
+
iface = gr.Interface(fn=question_answer, inputs=["text", "text"], outputs=["text"],
|
| 6 |
+
allow_flagging=True, #manual
|
| 7 |
+
#flagging_options=["correcto", "incorrecto"],
|
| 8 |
+
flagging_dir='flagged',
|
| 9 |
+
enable_queue = True)
|
| 10 |
+
iface.launch()
|