Przeglądaj źródła

Fix saving prompts on Windows

oobabooga 2 lat temu
rodzic
commit
90141bc1a8
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      server.py

+ 1 - 1
server.py

@@ -139,7 +139,7 @@ def create_model_and_preset_menus():
                 ui.create_refresh_button(shared.gradio['preset_menu'], lambda : None, lambda : {'choices': get_available_presets()}, 'refresh-button')
 
 def save_prompt(text):
-    fname = f"{datetime.now().strftime('%Y-%m-%d-%H:%M:%S')}.txt"
+    fname = f"{datetime.now().strftime('%Y-%m-%d-%H%M%S')}.txt"
     with open(Path(f'prompts/{fname}'), 'w', encoding='utf-8') as f:
         f.write(text)
     return f"Saved to prompts/{fname}"