Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -71,7 +71,7 @@ api_key = os.getenv("OPENAI_API_KEY")
|
|
71 |
|
72 |
|
73 |
@st.cache_resource
|
74 |
-
def load_vector_store(file_path, store_name, force_reload=
|
75 |
local_repo_path = "Private_Book"
|
76 |
vector_store_path = os.path.join(local_repo_path, f"{store_name}.pkl")
|
77 |
|
@@ -262,7 +262,7 @@ def page1():
|
|
262 |
st.error("File not found. Please check the file path.")
|
263 |
return
|
264 |
|
265 |
-
VectorStore = load_vector_store(pdf_path, "KH_Reform_2301", force_reload=
|
266 |
|
267 |
display_chat_history(st.session_state['chat_history_page1'])
|
268 |
|
@@ -381,7 +381,7 @@ def page2():
|
|
381 |
st.error("File not found. Please check the file path.")
|
382 |
return
|
383 |
|
384 |
-
VectorStore = load_vector_store(pdf_path2, "Buch_2301", force_reload=
|
385 |
|
386 |
|
387 |
|
@@ -504,7 +504,7 @@ def page3():
|
|
504 |
st.error("File not found. Please check the file path.")
|
505 |
return
|
506 |
|
507 |
-
VectorStore = load_vector_store(pdf_path3, "Kosten_Str_2301", force_reload=
|
508 |
|
509 |
|
510 |
|
|
|
71 |
|
72 |
|
73 |
@st.cache_resource
|
74 |
+
def load_vector_store(file_path, store_name, force_reload=True):
|
75 |
local_repo_path = "Private_Book"
|
76 |
vector_store_path = os.path.join(local_repo_path, f"{store_name}.pkl")
|
77 |
|
|
|
262 |
st.error("File not found. Please check the file path.")
|
263 |
return
|
264 |
|
265 |
+
VectorStore = load_vector_store(pdf_path, "KH_Reform_2301", force_reload=True)
|
266 |
|
267 |
display_chat_history(st.session_state['chat_history_page1'])
|
268 |
|
|
|
381 |
st.error("File not found. Please check the file path.")
|
382 |
return
|
383 |
|
384 |
+
VectorStore = load_vector_store(pdf_path2, "Buch_2301", force_reload=True)
|
385 |
|
386 |
|
387 |
|
|
|
504 |
st.error("File not found. Please check the file path.")
|
505 |
return
|
506 |
|
507 |
+
VectorStore = load_vector_store(pdf_path3, "Kosten_Str_2301", force_reload=True)
|
508 |
|
509 |
|
510 |
|