SRA25 commited on
Commit
be25fcb
·
verified ·
1 Parent(s): a5f59bd

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +7 -4
src/streamlit_app.py CHANGED
@@ -7,8 +7,11 @@ import logging
7
  import time
8
  import os
9
  from dotenv import load_dotenv
10
- from langchain_mymod.langgraph_init.UploadDocs import upload_documents
11
- from langchain_mymod.langgraph_init import submit_feedback, get_conversations,get_conversation_history, chat_with_rag, login_hf
 
 
 
12
  # --- 1. Configuration ---
13
  # API_URL = "https://sra25-fastapi-backend.hf.space"
14
  # API_URL = "http://localhost:8000"
@@ -173,7 +176,7 @@ with st.sidebar:
173
  if new_uploaded_files:
174
  st.session_state.uploaded_files_info.extend(newly_added_files_info)
175
  with st.spinner("Processing documents..."):
176
- process_status = upload_documents(new_uploaded_files)
177
  if process_status:
178
  st.session_state.retriever_ready = True
179
  # st.success(response_data.get("message", "Documents processed and knowledge base ready!"))
@@ -186,7 +189,7 @@ with st.sidebar:
186
  elif duplicate_file:
187
  # st.session_state.uploaded_files_info.extend(newly_added_files_info)
188
  with st.spinner("Processing documents..."):
189
- process_status = upload_documents(duplicate_file)
190
  if process_status:
191
  st.session_state.retriever_ready = True
192
  # st.success(response_data.get("message", "Documents processed and knowledge base ready!"))
 
7
  import time
8
  import os
9
  from dotenv import load_dotenv
10
+ from langgraph_init import UploadDocs
11
+ from langgraph_init import submit_feedback, get_conversations,get_conversation_history, chat_with_rag, login_hf
12
+
13
+ upd = UploadDocs()
14
+
15
  # --- 1. Configuration ---
16
  # API_URL = "https://sra25-fastapi-backend.hf.space"
17
  # API_URL = "http://localhost:8000"
 
176
  if new_uploaded_files:
177
  st.session_state.uploaded_files_info.extend(newly_added_files_info)
178
  with st.spinner("Processing documents..."):
179
+ process_status = upd.upload_documents(new_uploaded_files)
180
  if process_status:
181
  st.session_state.retriever_ready = True
182
  # st.success(response_data.get("message", "Documents processed and knowledge base ready!"))
 
189
  elif duplicate_file:
190
  # st.session_state.uploaded_files_info.extend(newly_added_files_info)
191
  with st.spinner("Processing documents..."):
192
+ process_status = upd.upload_documents(duplicate_file)
193
  if process_status:
194
  st.session_state.retriever_ready = True
195
  # st.success(response_data.get("message", "Documents processed and knowledge base ready!"))