Spaces:
Running
Running
yash001010
commited on
Commit
•
e741e3b
1
Parent(s):
bda6dd2
Update app.py
Browse files
app.py
CHANGED
@@ -43,6 +43,7 @@ try:
|
|
43 |
# Load the vector store from the local drive
|
44 |
script_dir = os.path.dirname(os.path.abspath(__file__))
|
45 |
persist_directory = os.path.join(script_dir, 'Embedded_Med_books')
|
|
|
46 |
|
47 |
# Debug information
|
48 |
st.sidebar.header("Debug Information")
|
@@ -58,11 +59,14 @@ try:
|
|
58 |
os.makedirs(persist_directory)
|
59 |
st.success("Directory created!")
|
60 |
|
61 |
-
|
62 |
vector_store = Chroma(
|
63 |
persist_directory=persist_directory,
|
64 |
embedding_function=embeddings
|
65 |
)
|
|
|
|
|
|
|
66 |
retriever = vector_store.as_retriever(search_kwargs={'k': 1})
|
67 |
|
68 |
# Initialize Groq client
|
|
|
43 |
# Load the vector store from the local drive
|
44 |
script_dir = os.path.dirname(os.path.abspath(__file__))
|
45 |
persist_directory = os.path.join(script_dir, 'Embedded_Med_books')
|
46 |
+
|
47 |
|
48 |
# Debug information
|
49 |
st.sidebar.header("Debug Information")
|
|
|
59 |
os.makedirs(persist_directory)
|
60 |
st.success("Directory created!")
|
61 |
|
62 |
+
try:
|
63 |
vector_store = Chroma(
|
64 |
persist_directory=persist_directory,
|
65 |
embedding_function=embeddings
|
66 |
)
|
67 |
+
except Exception as e:
|
68 |
+
st.error(f"Error loading vector store: {e}")
|
69 |
+
|
70 |
retriever = vector_store.as_retriever(search_kwargs={'k': 1})
|
71 |
|
72 |
# Initialize Groq client
|