Tuchuanhuhuhu commited on
Commit
9e09956
·
1 Parent(s): 4469696

bugfix: 修复重命名/删除历史记录时遗留多余的md文件的问题 fix #950

Browse files
Files changed (1) hide show
  1. modules/models/base_model.py +2 -0
modules/models/base_model.py CHANGED
@@ -811,8 +811,10 @@ class BaseLLMModel:
811
  history_file_path = os.path.join(HISTORY_DIR, user_name, filename)
812
  else:
813
  history_file_path = filename
 
814
  try:
815
  os.remove(history_file_path)
 
816
  return i18n("删除对话历史成功"), get_history_list(user_name), []
817
  except:
818
  logging.info(f"删除对话历史失败 {history_file_path}")
 
811
  history_file_path = os.path.join(HISTORY_DIR, user_name, filename)
812
  else:
813
  history_file_path = filename
814
+ md_history_file_path = history_file_path[:-5] + ".md"
815
  try:
816
  os.remove(history_file_path)
817
+ os.remove(md_history_file_path)
818
  return i18n("删除对话历史成功"), get_history_list(user_name), []
819
  except:
820
  logging.info(f"删除对话历史失败 {history_file_path}")