Spaces:
Sleeping
Sleeping
Tuchuanhuhuhu
commited on
Commit
·
147f60b
1
Parent(s):
9869ac7
chore: 优化新建对话时的行为
Browse files- ChuanhuChatbot.py +1 -1
- modules/models/base_model.py +3 -1
ChuanhuChatbot.py
CHANGED
|
@@ -501,7 +501,7 @@ with gr.Blocks(theme=small_and_beautiful_theme) as demo:
|
|
| 501 |
emptyBtn.click(
|
| 502 |
reset,
|
| 503 |
inputs=[current_model],
|
| 504 |
-
outputs=[chatbot, status_display],
|
| 505 |
show_progress=True,
|
| 506 |
_js='clearChatbot',
|
| 507 |
)
|
|
|
|
| 501 |
emptyBtn.click(
|
| 502 |
reset,
|
| 503 |
inputs=[current_model],
|
| 504 |
+
outputs=[chatbot, status_display, historyFileSelectDropdown],
|
| 505 |
show_progress=True,
|
| 506 |
_js='clearChatbot',
|
| 507 |
)
|
modules/models/base_model.py
CHANGED
|
@@ -626,7 +626,9 @@ class BaseLLMModel:
|
|
| 626 |
self.interrupted = False
|
| 627 |
self.history_file_path = new_auto_history_filename(
|
| 628 |
os.path.join(HISTORY_DIR, self.user_identifier))
|
| 629 |
-
|
|
|
|
|
|
|
| 630 |
|
| 631 |
def delete_first_conversation(self):
|
| 632 |
if self.history:
|
|
|
|
| 626 |
self.interrupted = False
|
| 627 |
self.history_file_path = new_auto_history_filename(
|
| 628 |
os.path.join(HISTORY_DIR, 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:
|