Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
| 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,12 +96,12 @@ def main():
|
|
| 96 |
st.success("Done")
|
| 97 |
|
| 98 |
# Check if any document is uploaded
|
| 99 |
-
if
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 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()
|