Huzaifa367 commited on
Commit
2258a9e
·
verified ·
1 Parent(s): bff728b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -87,8 +87,8 @@ def main():
87
 
88
  with st.sidebar:
89
  st.title("Menu:")
90
- pdf_docs = st.file_uploader("Upload your PDF Files and Click on the Submit & Process Button", accept_multiple_files=True, type=["pdf"])
91
- if st.button("Submit & Process"):
92
  with st.spinner("Processing..."):
93
  raw_text = get_pdf_text(pdf_docs)
94
  text_chunks = get_text_chunks(raw_text)
@@ -96,12 +96,12 @@ def main():
96
  st.success("Done")
97
 
98
  # Check if any document is uploaded
99
- if pdf_docs:
100
- if st.success("Done"):
101
- user_question = st.text_input("Ask a question from the Docs")
102
- if user_question:
103
- user_input(user_question, api_key)
104
  else:
105
- st.write("Please upload a document first to ask questions.")
 
106
  if __name__ == "__main__":
107
  main()
 
87
 
88
  with st.sidebar:
89
  st.title("Menu:")
90
+ pdf_docs = st.file_uploader("Upload your PDF Files and Click on the Submit Button", accept_multiple_files=True, type=["pdf"])
91
+ if st.button("Submit"):
92
  with st.spinner("Processing..."):
93
  raw_text = get_pdf_text(pdf_docs)
94
  text_chunks = get_text_chunks(raw_text)
 
96
  st.success("Done")
97
 
98
  # Check if any document is uploaded
99
+ if st.success("Done"):
100
+ user_question = st.text_input("Ask a question from the Docs")
101
+ if user_question:
102
+ user_input(user_question, api_key)
 
103
  else:
104
+ st.write("Please upload a document first to ask questions.")
105
+
106
  if __name__ == "__main__":
107
  main()