Spaces:
Sleeping
Sleeping
Chandranshu Jain
commited on
Commit
•
53afb19
1
Parent(s):
f7dd29a
Update app.py
Browse files
app.py
CHANGED
@@ -97,12 +97,13 @@ st.header("Chat with your pdf💁")
|
|
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 |
query = st.chat_input("Ask a Question from the PDF File")
|
102 |
if st.button("Submit & Process", key="process_button"):
|
103 |
#with st.spinner("Processing..."):
|
104 |
-
|
105 |
-
text_chunks = text_splitter(raw_text)
|
106 |
if query:
|
107 |
#st.session_state.messages.append({'role': 'user', "content": query})
|
108 |
response = embedding(text_chunks,query)
|
|
|
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 |
+
raw_text = get_pdf(pdf_docs)
|
101 |
+
text_chunks = text_splitter(raw_text)
|
102 |
|
103 |
query = st.chat_input("Ask a Question from the PDF File")
|
104 |
if st.button("Submit & Process", key="process_button"):
|
105 |
#with st.spinner("Processing..."):
|
106 |
+
|
|
|
107 |
if query:
|
108 |
#st.session_state.messages.append({'role': 'user', "content": query})
|
109 |
response = embedding(text_chunks,query)
|