bug fix
Browse files
app.py
CHANGED
@@ -89,17 +89,17 @@ def main():
|
|
89 |
user_question = st.text_input('Enter your message here:')
|
90 |
pdf_file = st.file_uploader("Upload PDF", type=['pdf'])
|
91 |
if st.button('Start Chain'):
|
92 |
-
|
93 |
-
|
94 |
pdf_text = get_pdf_text(pdf_file)
|
95 |
pdf_text_chunks = get_pdf_text_chunks(pdf_text)
|
96 |
st.session_state.vector_store = create_vector_store(pdf_text_chunks)
|
97 |
st.session_state.conversation = get_conversation_chain(
|
98 |
-
|
99 |
)
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
|
104 |
|
105 |
if user_question:
|
|
|
89 |
user_question = st.text_input('Enter your message here:')
|
90 |
pdf_file = st.file_uploader("Upload PDF", type=['pdf'])
|
91 |
if st.button('Start Chain'):
|
92 |
+
if pdf_file is not None:
|
93 |
+
with st.spinner('Working in progress ...'):
|
94 |
pdf_text = get_pdf_text(pdf_file)
|
95 |
pdf_text_chunks = get_pdf_text_chunks(pdf_text)
|
96 |
st.session_state.vector_store = create_vector_store(pdf_text_chunks)
|
97 |
st.session_state.conversation = get_conversation_chain(
|
98 |
+
retriever=st.session_state.vector_store,
|
99 |
)
|
100 |
+
st.success('Vectorstore created successfully! You can start chatting now!')
|
101 |
+
else:
|
102 |
+
st.warning('Please upload a PDF file first!')
|
103 |
|
104 |
|
105 |
if user_question:
|