Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -23,13 +23,13 @@ def question_model():
|
|
23 |
|
24 |
def question_answering(context, question):
|
25 |
with st.spinner(text="Loading question model..."):
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
|
34 |
# choose the source with different tabs
|
35 |
tab1, tab2 = st.tabs(["Input text", "Upload File"])
|
|
|
23 |
|
24 |
def question_answering(context, question):
|
25 |
with st.spinner(text="Loading question model..."):
|
26 |
+
question_answerer = question_model()
|
27 |
+
with st.spinner(text="Getting answer..."):
|
28 |
+
answer = question_answerer(context=context, question=question)
|
29 |
+
answer = answer["answer"]
|
30 |
+
# display the result in container
|
31 |
+
container = st.container(border=True)
|
32 |
+
container.write("<h5><b>Answer:</b></h5>" + answer + "<br>", unsafe_allow_html=True)
|
33 |
|
34 |
# choose the source with different tabs
|
35 |
tab1, tab2 = st.tabs(["Input text", "Upload File"])
|