OrifjonKenjayev commited on
Commit
fe64323
·
verified ·
1 Parent(s): 2a8c438

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -13,8 +13,17 @@ TOGETHER_API_KEY = os.getenv('TOGETHER_API_KEY')
13
 
14
  class ChatBot:
15
  def __init__(self):
16
- # Load the pre-created FAISS index
17
- self.vectorstore = FAISS.load_local("faiss_index")
 
 
 
 
 
 
 
 
 
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