fix(caption): use cache_dir for BLIP and Moondream model downloads

- Add _load_blip_model helper with explicit cache_dir so downloads
  go to hfcache_dir instead of default HF cache
- Pre-load BLIP model/processor before creating Interrogator config
  to control download location and avoid redundant loads
- Set clip_model_path on config for CLIP model cache location
- Add cache_dir to Moondream model and tokenizer loading
This commit is contained in:
CalamitousFelicitousness
2026-02-02 22:18:20 +00:00
parent 6c20e49897
commit 8d67debdfd
2 changed files with 29 additions and 3 deletions
+3 -1
View File
@@ -1288,12 +1288,14 @@ class VQA:
low_cpu_mem_usage=True,
use_flash_attn=False,
use_safetensors=True,
trust_remote_code=True)
trust_remote_code=True,
cache_dir=shared.opts.hfcache_dir)
self.model = self.model.eval() # required: trust_remote_code model
self.processor = transformers.AutoTokenizer.from_pretrained(
repo,
trust_remote_code=True,
use_fast=False,
cache_dir=shared.opts.hfcache_dir,
)
self.loaded = repo
devices.torch_gc()