mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user