justinj92 commited on
Commit
a1f83cd
·
verified ·
1 Parent(s): bc30e1c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -76,6 +76,8 @@ documents = loader.load()
76
 
77
  text_splitter = RecursiveCharacterTextSplitter(chunk_size = CFG.split_chunk_size, chunk_overlap = CFG.split_overlap)
78
 
 
 
79
  if not os.path.exists(CFG.Embeddings_path + '/index.faiss'):
80
  embeddings = HuggingFaceInstructEmbeddings(model_name = CFG.embeddings_model_repo, model_kwargs={"device":"cuda"})
81
  vectordb = FAISS.from_documents(documents=texts, embedding=embeddings)
 
76
 
77
  text_splitter = RecursiveCharacterTextSplitter(chunk_size = CFG.split_chunk_size, chunk_overlap = CFG.split_overlap)
78
 
79
+ texts = text_splitter.split_documents(documents)
80
+
81
  if not os.path.exists(CFG.Embeddings_path + '/index.faiss'):
82
  embeddings = HuggingFaceInstructEmbeddings(model_name = CFG.embeddings_model_repo, model_kwargs={"device":"cuda"})
83
  vectordb = FAISS.from_documents(documents=texts, embedding=embeddings)