setting for hf transfer mode

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-08-16 16:45:56 -04:00
parent 07d0f125d8
commit fbc50ce3e1
7 changed files with 54 additions and 38 deletions
+1 -12
View File
@@ -4,7 +4,7 @@ import sys
import json
import shlex
import argparse
from modules.errors import log
from installer import log
# parse args, parse again after we have the data-dir and early-read the config file
@@ -123,14 +123,3 @@ class Prioritize:
def __exit__(self, exc_type, exc_val, exc_tb):
sys.path = self.path
self.path = None
def check_cache(opts):
prev_default = os.environ.get("SD_HFCACHEDIR", None) or os.path.join(os.path.expanduser('~'), '.cache', 'huggingface', 'hub')
from modules.modelstats import stat
if opts.hfcache_dir != prev_default:
size, _mtime = stat(prev_default)
if size//1024//1024 > 0:
log.warning(f'Cache location changed: previous="{prev_default}" size={size//1024//1024} MB')
size, _mtime = stat(opts.hfcache_dir)
log.debug(f'Huggingface cache: path="{opts.hfcache_dir}" size={size//1024//1024} MB')