OOlajide commited on
Commit
a3068be
1 Parent(s): 8bfdd29

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -52,14 +52,14 @@ if option == "Extractive question answering":
52
  if uploaded_file is not None:
53
  raw_text = str(uploaded_file.read(),"utf-8")
54
  context = st.text_area("", value=raw_text, height=330)
55
- question = st.text_input(label="Enter your question")
56
- button = st.button("Get answer")
57
- if button:
58
- question_answerer = question_model()
59
- with st.spinner(text="Getting answer..."):
60
- answer = question_answerer(context=context, question=question)
61
- answer = answer["answer"]
62
- st.write(f"Answer ---> {answer}")
63
 
64
  elif option == 'Text summarization':
65
  st.markdown("<h2 style='text-align: center; color:red;'>Summarize text</h2>", unsafe_allow_html=True)
 
52
  if uploaded_file is not None:
53
  raw_text = str(uploaded_file.read(),"utf-8")
54
  context = st.text_area("", value=raw_text, height=330)
55
+ question = st.text_input(label="Enter your question")
56
+ button = st.button("Get answer")
57
+ if button:
58
+ question_answerer = question_model()
59
+ with st.spinner(text="Getting answer..."):
60
+ answer = question_answerer(context=context, question=question)
61
+ answer = answer["answer"]
62
+ st.write(f"Answer ---> {answer}")
63
 
64
  elif option == 'Text summarization':
65
  st.markdown("<h2 style='text-align: center; color:red;'>Summarize text</h2>", unsafe_allow_html=True)