Spaces:
Sleeping
Sleeping
Tuchuanhuhuhu
commited on
Commit
•
ed36f84
1
Parent(s):
8029644
修复summary时的出错的问题
Browse files- modules/index_func.py +1 -1
- modules/models/ChuanhuAgent.py +1 -0
modules/index_func.py
CHANGED
@@ -83,7 +83,7 @@ def get_documents(file_src):
|
|
83 |
logging.error(f"Error loading file: {filename}")
|
84 |
traceback.print_exc()
|
85 |
|
86 |
-
texts = text_splitter.split_documents(texts)
|
87 |
documents.extend(texts)
|
88 |
logging.debug("Documents loaded.")
|
89 |
return documents
|
|
|
83 |
logging.error(f"Error loading file: {filename}")
|
84 |
traceback.print_exc()
|
85 |
|
86 |
+
texts = text_splitter.split_documents([texts])
|
87 |
documents.extend(texts)
|
88 |
logging.debug("Documents loaded.")
|
89 |
return documents
|
modules/models/ChuanhuAgent.py
CHANGED
@@ -102,6 +102,7 @@ class ChuanhuAgent_Client(BaseLLMModel):
|
|
102 |
summary = chain({"input_documents": list(index.docstore.__dict__["_dict"].values())}, return_only_outputs=True)["output_text"]
|
103 |
logging.info(f"Summary: {summary}")
|
104 |
self.index_summary = summary
|
|
|
105 |
logging.info(cb)
|
106 |
return gr.Files.update(), chatbot, status
|
107 |
|
|
|
102 |
summary = chain({"input_documents": list(index.docstore.__dict__["_dict"].values())}, return_only_outputs=True)["output_text"]
|
103 |
logging.info(f"Summary: {summary}")
|
104 |
self.index_summary = summary
|
105 |
+
chatbot.append((f"Uploaded {len(files)} files", summary))
|
106 |
logging.info(cb)
|
107 |
return gr.Files.update(), chatbot, status
|
108 |
|