Spaces:
Runtime error
Runtime error
ChenyuRabbitLove
commited on
Commit
·
a779e10
1
Parent(s):
c06edf7
fix/fix build KB function
Browse files- utils/chatbot.py +4 -4
utils/chatbot.py
CHANGED
@@ -32,15 +32,15 @@ class Chatbot:
|
|
32 |
self.context_page_num = None
|
33 |
self.context_file_name = None
|
34 |
|
35 |
-
def build_knowledge_base(self, files, upload_mode="
|
36 |
work_flow_controller = WorkFlowController(files, self.uid)
|
37 |
self.csv_result_path = work_flow_controller.csv_result_path
|
38 |
self.json_result_path = work_flow_controller.json_result_path
|
39 |
|
40 |
-
if upload_mode == "
|
41 |
-
self.
|
42 |
else:
|
43 |
-
self.
|
44 |
|
45 |
def __get_db_knowledge_base(self):
|
46 |
filename = "knowledge_base.csv"
|
|
|
32 |
self.context_page_num = None
|
33 |
self.context_file_name = None
|
34 |
|
35 |
+
def build_knowledge_base(self, files, upload_mode="once"):
|
36 |
work_flow_controller = WorkFlowController(files, self.uid)
|
37 |
self.csv_result_path = work_flow_controller.csv_result_path
|
38 |
self.json_result_path = work_flow_controller.json_result_path
|
39 |
|
40 |
+
if upload_mode == "Upload to Database":
|
41 |
+
self.__get_db_knowledge_base()
|
42 |
else:
|
43 |
+
self.__get_local_knowledge_base()
|
44 |
|
45 |
def __get_db_knowledge_base(self):
|
46 |
filename = "knowledge_base.csv"
|