mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-01 01:26:03 -04:00
Fix saving prompts on Windows
This commit is contained in:
parent
cf2c4e740b
commit
90141bc1a8
@ -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')
|
ui.create_refresh_button(shared.gradio['preset_menu'], lambda : None, lambda : {'choices': get_available_presets()}, 'refresh-button')
|
||||||
|
|
||||||
def save_prompt(text):
|
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:
|
with open(Path(f'prompts/{fname}'), 'w', encoding='utf-8') as f:
|
||||||
f.write(text)
|
f.write(text)
|
||||||
return f"Saved to prompts/{fname}"
|
return f"Saved to prompts/{fname}"
|
||||||
|
Loading…
Reference in New Issue
Block a user