From 98ecdda78d9c7e8536eceef3b66db0d52f22fcc4 Mon Sep 17 00:00:00 2001 From: zealot52099 Date: Mon, 18 Mar 2024 10:46:09 +0800 Subject: [PATCH] fix bug --- rag/src/data_processing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rag/src/data_processing.py b/rag/src/data_processing.py index e3215fd..45ff3f0 100644 --- a/rag/src/data_processing.py +++ b/rag/src/data_processing.py @@ -63,8 +63,8 @@ def split_document(data_path, chunk_size=1000, chunk_overlap=100): # logger.info(f"splits type {type(splits[0])}") # logger.info(f'splits size {len(splits)}') split_docs += splits - elif file.endswith('.txt'): - file_path = os.path.join(root, file) + elif data_path.endswith('.txt'): + file_path = os.path.join(root, data_path) # logger.info(f'splitting file {file_path}') text_loader = TextLoader(file_path, encoding='utf-8') text = text_loader.load()