rahuln2002 commited on
Commit
e7f96e3
·
verified ·
1 Parent(s): da624b9

Update knowledgeassistant/components/RAG.py

Browse files
knowledgeassistant/components/RAG.py CHANGED
@@ -38,7 +38,8 @@ class RAG:
38
 
39
  def create_and_store_embeddings(self, documents: list):
40
  try:
41
- db = FAISS.from_documents(documents, HuggingFaceEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2"))
 
42
  return db
43
  except Exception as e:
44
  raise KnowledgeAssistantException(e, sys)
 
38
 
39
  def create_and_store_embeddings(self, documents: list):
40
  try:
41
+ embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2")
42
+ db = FAISS.from_documents(documents, embeddings)
43
  return db
44
  except Exception as e:
45
  raise KnowledgeAssistantException(e, sys)