bstraehle commited on
Commit
a457c54
·
1 Parent(s): 78f2651

Update rag_langchain.py

Browse files
Files changed (1) hide show
  1. rag_langchain.py +5 -2
rag_langchain.py CHANGED
@@ -54,14 +54,17 @@ class LangChainRAG(BaseRAG):
54
  return docs
55
 
56
  def split_documents(self, config, docs):
57
- text_splitter = RecursiveCharacterTextSplitter()
 
 
 
58
 
59
  return text_splitter.split_documents(docs)
60
 
61
  def store_documents_chroma(self, chunks):
62
  Chroma.from_documents(
63
  documents = chunks,
64
- embedding = OpenAIEmbeddings(disallowed_special = ()),
65
  persist_directory = self.CHROMA_DIR
66
  )
67
 
 
54
  return docs
55
 
56
  def split_documents(self, config, docs):
57
+ text_splitter = RecursiveCharacterTextSplitter(
58
+ chunk_overlap = config["chunk_overlap"],
59
+ chunk_size = config["chunk_size"]
60
+ )
61
 
62
  return text_splitter.split_documents(docs)
63
 
64
  def store_documents_chroma(self, chunks):
65
  Chroma.from_documents(
66
  documents = chunks,
67
+ embedding = OpenAIEmbeddings(disallowed_special = ()), # embed
68
  persist_directory = self.CHROMA_DIR
69
  )
70