merge commits

This commit is contained in:
Vladimir Mandic
2023-05-02 15:06:06 -04:00
parent cb4cff3929
commit 7a083d322b
13 changed files with 54 additions and 12 deletions
+2 -2
View File
@@ -34,7 +34,7 @@ def download_default_clip_interrogate_categories(content_dir):
cat_types = ["artists", "flavors", "mediums", "movements"]
try:
os.makedirs(tmpdir)
os.makedirs(tmpdir, exist_ok=True)
for category_type in cat_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)
@@ -43,7 +43,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: