mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-04 22:27:29 +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
|
|
@ -168,7 +168,8 @@ def get_SD_pictures(description, character):
|
|||
|
||||
variadic = f'{date.today().strftime("%Y_%m_%d")}/{character}_{int(time.time())}'
|
||||
output_file = Path(f'extensions/sd_api_pictures/outputs/{variadic}.png')
|
||||
output_file.parent.mkdir(parents=True, exist_ok=True)
|
||||
if not output_file.parent.exists():
|
||||
output_file.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
with open(output_file.as_posix(), 'wb') as f:
|
||||
f.write(img_data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue