From d1a8edae13e8dfcf27aa4b255ae3b70558db77bc Mon Sep 17 00:00:00 2001 From: toshiaki1729 <116595002+toshiaki1729@users.noreply.github.com> Date: Wed, 8 May 2024 04:24:33 +0900 Subject: [PATCH] blip2 model path --- .gitignore | 3 ++- scripts/dataset_tag_editor/interrogators/blip2_captioning.py | 4 ++-- scripts/paths.py | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 9871132..3c39af7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # Byte-compiled / optimized / DLL files __pycache__/ config.json -.vscode/ \ No newline at end of file +.vscode/ +models/ \ No newline at end of file diff --git a/scripts/dataset_tag_editor/interrogators/blip2_captioning.py b/scripts/dataset_tag_editor/interrogators/blip2_captioning.py index 179c3f4..4d37ab3 100644 --- a/scripts/dataset_tag_editor/interrogators/blip2_captioning.py +++ b/scripts/dataset_tag_editor/interrogators/blip2_captioning.py @@ -13,10 +13,10 @@ class BLIP2Captioning: def load(self): if self.model is None or self.processor is None: self.processor = Blip2Processor.from_pretrained( - self.MODEL_REPO, cache_dir=paths.setting_model_path + self.MODEL_REPO, cache_dir=paths.model_path / "aesthetic" ) self.model = Blip2ForConditionalGeneration.from_pretrained( - self.MODEL_REPO, cache_dir=paths.setting_model_path + self.MODEL_REPO, cache_dir=paths.model_path / "aesthetic" ).to(devices.device) def unload(self): diff --git a/scripts/paths.py b/scripts/paths.py index 7495da7..de86969 100644 --- a/scripts/paths.py +++ b/scripts/paths.py @@ -13,5 +13,6 @@ class Paths(Singleton): self.base_path:Path = base_dir_path() self.script_path: Path = self.base_path / "scripts" self.userscript_path: Path = self.base_path / "userscripts" + self.model_path = self.base_path / "models" paths = Paths() \ No newline at end of file