Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -74,15 +74,15 @@ class MyEmbeddingFunction(EmbeddingFunction):
|
|
74 |
except Exception as e:
|
75 |
print("Error in Embeding :",str(e))
|
76 |
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
#
|
84 |
-
|
85 |
-
|
86 |
|
87 |
# Initialize the database without persist_directory
|
88 |
try:
|
|
|
74 |
except Exception as e:
|
75 |
print("Error in Embeding :",str(e))
|
76 |
|
77 |
+
try:
|
78 |
+
CHROMA_PATH = "chroma"
|
79 |
+
custom_embeddings = MyEmbeddingFunction()
|
80 |
+
db = Chroma(
|
81 |
+
persist_directory=CHROMA_PATH,embedding_function=custom_embeddings
|
82 |
+
)
|
83 |
+
#
|
84 |
+
except Exception as e:
|
85 |
+
print("Error in database :",str(e))
|
86 |
|
87 |
# Initialize the database without persist_directory
|
88 |
try:
|