diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-04-29 07:04:01 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-04-29 07:04:01 +0000 |
commit | 642d96dcc83a66547899896c410bc27a34924c3f (patch) | |
tree | 682135f0642a0dc6f4228f34cdfeb98bf56b3513 /modules | |
parent | 39654cc905ec40fe8191c07f1f54f54dd436848d (diff) | |
download | stable-diffusion-webui-gfx803-642d96dcc83a66547899896c410bc27a34924c3f.tar.gz stable-diffusion-webui-gfx803-642d96dcc83a66547899896c410bc27a34924c3f.tar.bz2 stable-diffusion-webui-gfx803-642d96dcc83a66547899896c410bc27a34924c3f.zip |
use exist_ok=True instead of checking if directory exists
Diffstat (limited to 'modules')
-rw-r--r-- | modules/interrogate.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/interrogate.py b/modules/interrogate.py index ecdb11bb..e1665708 100644 --- a/modules/interrogate.py +++ b/modules/interrogate.py @@ -32,8 +32,7 @@ def download_default_clip_interrogate_categories(content_dir): category_types = ["artists", "flavors", "mediums", "movements"]
try:
- if not os.path.exists(tmpdir):
- os.makedirs(tmpdir)
+ os.makedirs(tmpdir, exist_ok=True)
for category_type in category_types:
torch.hub.download_url_to_file(f"https://raw.githubusercontent.com/pharmapsychotic/clip-interrogator/main/clip_interrogator/data/{category_type}.txt", os.path.join(tmpdir, f"{category_type}.txt"))
os.rename(tmpdir, content_dir)
|