reab5555 commited on
Commit
dbeded7
·
verified ·
1 Parent(s): ba6439c

Update processing.py

Browse files
Files changed (1) hide show
  1. processing.py +7 -0
processing.py CHANGED
@@ -26,6 +26,13 @@ def load_instructions(file_path):
26
  with open(file_path, 'r') as file:
27
  return file.read().strip()
28
 
 
 
 
 
 
 
 
29
  general_task = load_instructions("tasks/general_task.txt")
30
  attachments_task = load_instructions("tasks/Attachments_task.txt")
31
  bigfive_task = load_instructions("tasks/BigFive_task.txt")
 
26
  with open(file_path, 'r') as file:
27
  return file.read().strip()
28
 
29
+ def load_knowledge(file_path):
30
+ loader = TextLoader(file_path)
31
+ documents = loader.load()
32
+ text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
33
+ texts = text_splitter.split_documents(documents)
34
+ return texts
35
+
36
  general_task = load_instructions("tasks/general_task.txt")
37
  attachments_task = load_instructions("tasks/Attachments_task.txt")
38
  bigfive_task = load_instructions("tasks/BigFive_task.txt")