Spaces:
Sleeping
Sleeping
fix: 新建对话时清空system prompt
Browse files- ChuanhuChatbot.py +1 -1
- modules/models/base_model.py +2 -2
ChuanhuChatbot.py
CHANGED
@@ -583,7 +583,7 @@ with gr.Blocks(theme=small_and_beautiful_theme) as demo:
|
|
583 |
emptyBtn.click(
|
584 |
reset,
|
585 |
inputs=[current_model],
|
586 |
-
outputs=[chatbot, status_display, historySelectList],
|
587 |
show_progress=True,
|
588 |
_js='clearChatbot',
|
589 |
)
|
|
|
583 |
emptyBtn.click(
|
584 |
reset,
|
585 |
inputs=[current_model],
|
586 |
+
outputs=[chatbot, status_display, historySelectList, systemPromptTxt],
|
587 |
show_progress=True,
|
588 |
_js='clearChatbot',
|
589 |
)
|
modules/models/base_model.py
CHANGED
@@ -628,7 +628,7 @@ class BaseLLMModel:
|
|
628 |
self.history_file_path = new_auto_history_filename(self.user_identifier)
|
629 |
history_name = self.history_file_path[:-5]
|
630 |
choices = [history_name] + get_history_names(self.user_identifier)
|
631 |
-
return [], self.token_message([0]), gr.Radio.update(choices=choices, value=history_name)
|
632 |
|
633 |
def delete_first_conversation(self):
|
634 |
if self.history:
|
@@ -738,7 +738,7 @@ class BaseLLMModel:
|
|
738 |
except:
|
739 |
# 没有对话历史或者对话历史解析失败
|
740 |
logging.info(f"没有找到对话历史记录 {self.history_file_path}")
|
741 |
-
return self.history_file_path,
|
742 |
|
743 |
def delete_chat_history(self, filename, user_name):
|
744 |
if filename == "CANCELED":
|
|
|
628 |
self.history_file_path = new_auto_history_filename(self.user_identifier)
|
629 |
history_name = self.history_file_path[:-5]
|
630 |
choices = [history_name] + get_history_names(self.user_identifier)
|
631 |
+
return [], self.token_message([0]), gr.Radio.update(choices=choices, value=history_name), ""
|
632 |
|
633 |
def delete_first_conversation(self):
|
634 |
if self.history:
|
|
|
738 |
except:
|
739 |
# 没有对话历史或者对话历史解析失败
|
740 |
logging.info(f"没有找到对话历史记录 {self.history_file_path}")
|
741 |
+
return self.history_file_path, "", []
|
742 |
|
743 |
def delete_chat_history(self, filename, user_name):
|
744 |
if filename == "CANCELED":
|