Ankitajadhav commited on
Commit
a623cc7
·
verified ·
1 Parent(s): d8e24d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
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
- self.embedding_model = SentenceTransformer('sentence-transformers/multi-qa-MiniLM-L6-cos-v1')
 
 
 
 
 
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