Spaces:
Sleeping
Sleeping
Chandranshu Jain
commited on
Commit
•
6f8c5b6
1
Parent(s):
3fd640b
Update app.py
Browse files
app.py
CHANGED
@@ -90,23 +90,16 @@ def embedding(chunk,query):
|
|
90 |
|
91 |
|
92 |
|
93 |
-
|
94 |
-
|
95 |
-
st.
|
96 |
-
st.
|
97 |
-
with st.sidebar:
|
98 |
-
st.title("PDF FILE UPLOAD:")
|
99 |
-
pdf_docs = st.file_uploader("Upload your PDF File and Click on the Submit & Process Button", accept_multiple_files=False, key="pdf_uploader")
|
100 |
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
if __name__ == "__main__":
|
112 |
-
main()
|
|
|
90 |
|
91 |
|
92 |
|
93 |
+
st.header("Chat with your pdf💁")
|
94 |
+
with st.sidebar:
|
95 |
+
st.title("PDF FILE UPLOAD:")
|
96 |
+
pdf_docs = st.file_uploader("Upload your PDF File and Click on the Submit & Process Button", accept_multiple_files=False, key="pdf_uploader")
|
|
|
|
|
|
|
97 |
|
98 |
+
query = st.text_input("Ask a Question from the PDF File", key="query")
|
99 |
+
if st.button("Submit & Process", key="process_button"):
|
100 |
+
with st.spinner("Processing..."):
|
101 |
+
raw_text = get_pdf(pdf_docs)
|
102 |
+
text_chunks = text_splitter(raw_text)
|
103 |
+
if query:
|
104 |
+
embedding(text_chunks,query)
|
105 |
+
st.success("Done")
|
|
|
|
|
|
|
|