kxx-kkk commited on
Commit
9f96f81
·
verified ·
1 Parent(s): 3361ae0

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
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
- 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"])
 
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"])