Update data_processing.py format

This commit is contained in:
HongCheng 2024-05-03 00:48:46 +09:00 committed by GitHub
parent e01eea5984
commit 93a7a8c25d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -145,9 +145,9 @@ class Data_process():
split_docs = []
logger.info(f'Loading txt files from {data_path}')
if os.path.isdir(data_path):
loader = DirectoryLoader(data_path, glob="**/*.txt",show_progress=True)
docs = loader.load()
split_docs = text_spliter.split_documents(docs)
loader = DirectoryLoader(data_path, glob="**/*.txt",show_progress=True)
docs = loader.load()
split_docs = text_spliter.split_documents(docs)
elif data_path.endswith('.txt'):
file_path = data_path
logger.info(f'splitting file {file_path}')