Shubham170793 commited on
Commit
2315af4
Β·
verified Β·
1 Parent(s): ca5587a

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +3 -3
src/streamlit_app.py CHANGED
@@ -175,14 +175,14 @@ if doc_choice == "-- Select --":
175
  else:
176
  if doc_choice == "Sample PDF":
177
  temp_path = os.path.join(os.path.dirname(__file__), "sample.pdf")
178
- st.success("πŸ“˜ Sample PDF loaded successfully. You can now ask below.")
179
  else:
180
  uploaded_file = st.file_uploader("", type="pdf", label_visibility="collapsed")
181
  if uploaded_file:
182
  temp_path = os.path.join("/tmp", uploaded_file.name)
183
  with open(temp_path, "wb") as f:
184
  f.write(uploaded_file.getbuffer())
185
- st.success(f"βœ… '{uploaded_file.name}' uploaded successfully. You can now ask below.")
186
  else:
187
  temp_path = None
188
 
@@ -193,7 +193,6 @@ else:
193
  with st.spinner("βš™οΈ Building search index..."):
194
  embeddings = cache_embeddings(os.path.basename(temp_path), chunks, embed_chunks)
195
  index = build_faiss_index(embeddings)
196
- st.success("βœ… Document ready β€” you can now ask your question below.")
197
 
198
  doc_name = os.path.basename(temp_path)
199
  if st.session_state["last_doc"] != doc_name:
@@ -203,6 +202,7 @@ else:
203
  else:
204
  query_suggestions = st.session_state["query_suggestions_fixed"]
205
 
 
206
  # ----------------------------------------------------------
207
  # πŸ’¬ ASK SECTION
208
  # ----------------------------------------------------------
 
175
  else:
176
  if doc_choice == "Sample PDF":
177
  temp_path = os.path.join(os.path.dirname(__file__), "sample.pdf")
178
+ st.success("πŸ“˜ Sample document loaded successfully β€” you can start asking your questions below.")
179
  else:
180
  uploaded_file = st.file_uploader("", type="pdf", label_visibility="collapsed")
181
  if uploaded_file:
182
  temp_path = os.path.join("/tmp", uploaded_file.name)
183
  with open(temp_path, "wb") as f:
184
  f.write(uploaded_file.getbuffer())
185
+ st.success("βœ… Document processed successfully β€” you can start asking your questions below.")
186
  else:
187
  temp_path = None
188
 
 
193
  with st.spinner("βš™οΈ Building search index..."):
194
  embeddings = cache_embeddings(os.path.basename(temp_path), chunks, embed_chunks)
195
  index = build_faiss_index(embeddings)
 
196
 
197
  doc_name = os.path.basename(temp_path)
198
  if st.session_state["last_doc"] != doc_name:
 
202
  else:
203
  query_suggestions = st.session_state["query_suggestions_fixed"]
204
 
205
+
206
  # ----------------------------------------------------------
207
  # πŸ’¬ ASK SECTION
208
  # ----------------------------------------------------------