captain-awesome
commited on
Commit
·
4c2398a
1
Parent(s):
0e77c95
Update app.py
Browse files
app.py
CHANGED
@@ -367,6 +367,8 @@ def main():
|
|
367 |
# prompt = set_custom_prompt()
|
368 |
# CONDENSE_QUESTION_PROMPT = set_custom_prompt_condense()
|
369 |
# db = create_vector_database(loaded_documents)
|
|
|
|
|
370 |
persist_directory = 'db'
|
371 |
# Create and persist a Chroma vector database from the chunked documents
|
372 |
db = Chroma.from_documents(documents=chunked_documents,embedding=embeddings,persist_directory=persist_directory)
|
|
|
367 |
# prompt = set_custom_prompt()
|
368 |
# CONDENSE_QUESTION_PROMPT = set_custom_prompt_condense()
|
369 |
# db = create_vector_database(loaded_documents)
|
370 |
+
text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=30, length_function = len)
|
371 |
+
chunked_documents = text_splitter.split_documents(loaded_documents)
|
372 |
persist_directory = 'db'
|
373 |
# Create and persist a Chroma vector database from the chunked documents
|
374 |
db = Chroma.from_documents(documents=chunked_documents,embedding=embeddings,persist_directory=persist_directory)
|