ivyblossom commited on
Commit
011e1bd
1 Parent(s): 272eebb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -38,15 +38,16 @@ def main():
38
  st.warning("No questions entered.")
39
  return
40
 
41
- # Perform question-answering
42
- answers = question_answering(questions, pdf_text)
43
-
44
- st.subheader("Questions and Answers:")
45
- for i, (question, answer) in enumerate(zip(questions, answers)):
46
- st.write(f"Question {i + 1}: '{question}'")
47
- st.write("Answer:", answer['answer'])
48
- st.write(f"Score: {answer['score']:.2f}") # Format the score to 2 decimal places
49
- st.write("") # Add a new line after each answer
 
50
 
51
  if __name__ == "__main__":
52
  main()
 
38
  st.warning("No questions entered.")
39
  return
40
 
41
+ if st.button("Get Answers"):
42
+ # Perform question-answering
43
+ answers = question_answering(questions, pdf_text)
44
+
45
+ st.subheader("Questions and Answers:")
46
+ for i, (question, answer) in enumerate(zip(questions, answers)):
47
+ st.write(f"Question {i + 1}: '{question}'")
48
+ st.write("Answer:", answer['answer'])
49
+ st.write(f"Score: {answer['score']:.2f}") # Format the score to 2 decimal places
50
+ st.write("") # Add a new line after each answer
51
 
52
  if __name__ == "__main__":
53
  main()