mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-05 22:55:22 +00:00
Safer usage of mkdir across the project
This commit is contained in:
parent
8689d7ecea
commit
0d1597616f
16 changed files with 240 additions and 206 deletions
|
|
@ -409,7 +409,9 @@ def _perform_debounced_save():
|
|||
if _last_interface_state is not None:
|
||||
contents = save_settings(_last_interface_state, _last_preset, _last_extensions, _last_show_controls, _last_theme_state, manual_save=False)
|
||||
settings_path = Path('user_data') / 'settings.yaml'
|
||||
settings_path.parent.mkdir(exist_ok=True)
|
||||
if not settings_path.parent.exists():
|
||||
settings_path.parent.mkdir(exist_ok=True)
|
||||
|
||||
with open(settings_path, 'w', encoding='utf-8') as f:
|
||||
f.write(contents)
|
||||
except Exception as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue