diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-04-29 07:03:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-29 07:03:07 +0000 |
commit | 39654cc905ec40fe8191c07f1f54f54dd436848d (patch) | |
tree | b6c6a4cb16c1bdce12cecc99eafdfb5c6ad1a79b /modules/interrogate.py | |
parent | b0f55d374e547528e89aea1060309736719ba0f9 (diff) | |
parent | bb426de1cd1380844eb048f242bca6aa254edf58 (diff) | |
download | stable-diffusion-webui-gfx803-39654cc905ec40fe8191c07f1f54f54dd436848d.tar.gz stable-diffusion-webui-gfx803-39654cc905ec40fe8191c07f1f54f54dd436848d.tar.bz2 stable-diffusion-webui-gfx803-39654cc905ec40fe8191c07f1f54f54dd436848d.zip |
Merge pull request #9867 from darnell8/master
Fix CLIP FileExistsError
Diffstat (limited to 'modules/interrogate.py')
-rw-r--r-- | modules/interrogate.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/interrogate.py b/modules/interrogate.py index cbb80683..ecdb11bb 100644 --- a/modules/interrogate.py +++ b/modules/interrogate.py @@ -32,7 +32,8 @@ def download_default_clip_interrogate_categories(content_dir): category_types = ["artists", "flavors", "mediums", "movements"]
try:
- os.makedirs(tmpdir)
+ if not os.path.exists(tmpdir):
+ os.makedirs(tmpdir)
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)
@@ -41,7 +42,7 @@ def download_default_clip_interrogate_categories(content_dir): errors.display(e, "downloading default CLIP interrogate categories")
finally:
if os.path.exists(tmpdir):
- os.remove(tmpdir)
+ os.removedirs(tmpdir)
class InterrogateModels:
|