LiamDowd commited on
Commit
eaddfe1
1 Parent(s): 8648ebb

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -3
main.py CHANGED
@@ -218,11 +218,14 @@ def newFile(files, filepaths):
218
  text_splitter = RecursiveCharacterTextSplitter(
219
  chunk_size=1000, chunk_overlap=0, separators=[" ", ",", "\n"]
220
  )
 
221
  embeddings = HuggingFaceEmbeddings()
222
  #STORES TO CHROMA DB
223
- docs = [Document(page_content=x) for x in text_splitter.split_text(fileText)]
224
- print(docs)
225
- db = Chroma.from_documents(docs, embeddings, persist_directory= baseFilePath + "chroma_db")
 
 
226
  print("Done processing: " + filepaths[count].split("/")[-1])
227
  count = count + 1
228
 
 
218
  text_splitter = RecursiveCharacterTextSplitter(
219
  chunk_size=1000, chunk_overlap=0, separators=[" ", ",", "\n"]
220
  )
221
+ texts = text_splitter.split_text(fileText)
222
  embeddings = HuggingFaceEmbeddings()
223
  #STORES TO CHROMA DB
224
+ #docs = [Document(page_content=x) for x in text_splitter.split_text(fileText)]
225
+ #print(docs)
226
+ print(texts)
227
+ chromaDirectory = baseFilePath + "chroma_db"
228
+ db = Chroma.from_documents(texts, embeddings, persist_directory=chromaDirectory)
229
  print("Done processing: " + filepaths[count].split("/")[-1])
230
  count = count + 1
231