Spaces:
Runtime error
Runtime error
Ankitajadhav
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,12 @@ import gradio as gr
|
|
14 |
class VectorStore:
|
15 |
def __init__(self, collection_name):
|
16 |
# Initialize the embedding model
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
18 |
self.chroma_client = chromadb.Client()
|
19 |
self.collection = self.chroma_client.create_collection(name=collection_name)
|
20 |
|
|
|
14 |
class VectorStore:
|
15 |
def __init__(self, collection_name):
|
16 |
# Initialize the embedding model
|
17 |
+
# Initialize the embedding model with try-except block for better error handling
|
18 |
+
try:
|
19 |
+
self.embedding_model = SentenceTransformer('sentence-transformers/multi-qa-MiniLM-L6-cos-v1')
|
20 |
+
except Exception as e:
|
21 |
+
print(f"Error loading model: {e}")
|
22 |
+
raise
|
23 |
self.chroma_client = chromadb.Client()
|
24 |
self.collection = self.chroma_client.create_collection(name=collection_name)
|
25 |
|