Tuchuanhuhuhu commited on
Commit
38abe30
·
1 Parent(s): bff571d

bugfix: saving file will fail on Windows #883

Browse files
Files changed (1) hide show
  1. modules/utils.py +1 -1
modules/utils.py CHANGED
@@ -352,7 +352,7 @@ def save_file(filename, system, history, chatbot, user_name):
352
  with open(history_file_path, "w", encoding='utf-8') as f:
353
  json.dump(json_s, f, ensure_ascii=False)
354
 
355
- filename = filename.split("/")[-1]
356
  filename_md = filename[:-5] + ".md"
357
  md_s = f"system: \n- {system} \n"
358
  for data in history:
 
352
  with open(history_file_path, "w", encoding='utf-8') as f:
353
  json.dump(json_s, f, ensure_ascii=False)
354
 
355
+ filename = os.path.basename(filename)
356
  filename_md = filename[:-5] + ".md"
357
  md_s = f"system: \n- {system} \n"
358
  for data in history: