Spaces:
Runtime error
Runtime error
Leotis
commited on
Commit
•
eefbd1f
1
Parent(s):
2e7b7ee
format doc
Browse files
app.py
CHANGED
@@ -1,12 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
-
from inference import
|
3 |
|
4 |
-
qa = Question_and_Answer_System()
|
5 |
|
6 |
|
7 |
def ask_question(question):
|
8 |
prediction = qa.answer_question(question)
|
9 |
-
|
|
|
|
|
|
|
10 |
|
11 |
iface = gr.Interface(fn=ask_question, inputs="text", outputs="text")
|
12 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from inference import Question_and_Answer_System
|
3 |
|
4 |
+
qa = Question_and_Answer_System()
|
5 |
|
6 |
|
7 |
def ask_question(question):
|
8 |
prediction = qa.answer_question(question)
|
9 |
+
answers = prediction["answers"]
|
10 |
+
answer = prediction["answers"][0].answer
|
11 |
+
return answer
|
12 |
+
|
13 |
|
14 |
iface = gr.Interface(fn=ask_question, inputs="text", outputs="text")
|
15 |
iface.launch()
|