Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,8 +13,17 @@ TOGETHER_API_KEY = os.getenv('TOGETHER_API_KEY')
|
|
13 |
|
14 |
class ChatBot:
|
15 |
def __init__(self):
|
16 |
-
#
|
17 |
-
self.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
self.retriever = self.vectorstore.as_retriever()
|
19 |
|
20 |
# Initialize the model
|
|
|
13 |
|
14 |
class ChatBot:
|
15 |
def __init__(self):
|
16 |
+
# Initialize embeddings
|
17 |
+
self.embeddings = TogetherEmbeddings(
|
18 |
+
model="togethercomputer/m2-bert-80M-8k-retrieval",
|
19 |
+
together_api_key=TOGETHER_API_KEY
|
20 |
+
)
|
21 |
+
|
22 |
+
# Load the pre-created FAISS index with embeddings
|
23 |
+
self.vectorstore = FAISS.load_local(
|
24 |
+
"faiss_index",
|
25 |
+
embeddings=self.embeddings
|
26 |
+
)
|
27 |
self.retriever = self.vectorstore.as_retriever()
|
28 |
|
29 |
# Initialize the model
|