kxx-kkk commited on
Commit
105f589
1 Parent(s): 9286461

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -6,7 +6,6 @@ st.title("Automated Question Answering System")
6
  st.subheader("Try")
7
 
8
  @st.cache_resource(show_spinner=True)
9
-
10
  def question_model():
11
  model_name = "deepset/roberta-base-squad2"
12
  question_answerer = pipeline(model=model_name, tokenizer=model_name, task="question-answering")
@@ -33,8 +32,8 @@ with tab1:
33
  with st.spinner(text="Getting answer..."):
34
  answer = question_answerer(context=context, question=question)
35
  answer = answer["answer"]
36
- st.success("<b>Answer: </b> <hr>" + answer)
37
-
38
  with tab2:
39
  uploaded_file = st.file_uploader("Choose a .txt file to upload", type=["txt"])
40
  if uploaded_file is not None:
 
6
  st.subheader("Try")
7
 
8
  @st.cache_resource(show_spinner=True)
 
9
  def question_model():
10
  model_name = "deepset/roberta-base-squad2"
11
  question_answerer = pipeline(model=model_name, tokenizer=model_name, task="question-answering")
 
32
  with st.spinner(text="Getting answer..."):
33
  answer = question_answerer(context=context, question=question)
34
  answer = answer["answer"]
35
+ st.success(answer, icon="✅", unsafe_allow_html=True)
36
+
37
  with tab2:
38
  uploaded_file = st.file_uploader("Choose a .txt file to upload", type=["txt"])
39
  if uploaded_file is not None: