Fix infinite HF retry storm when loading a cached model offline

model_load_progress() already received is_cached but never forwarded it
to force_offline_if_cached(), which is fully unit-tested but had zero
callers. A fully-cached model still resolved every config file against
huggingface.co, eating the default 5-retry backoff per file offline.
This commit is contained in:
Roman Dolgov
2026-10-03 09:18:41 +00:00
committed by jamiepine
parent 51f49dea19
commit 0517c0687a
3 changed files with 66 additions and 1 deletions
+3 -1
View File
@@ -14,6 +14,7 @@ from typing import Callable, List, Optional, Tuple
import numpy as np
from ..utils.audio import normalize_audio, load_audio
from ..utils.hf_offline_patch import force_offline_if_cached
from ..utils.progress import get_progress_manager
from ..utils.hf_progress import HFProgressTracker, create_hf_progress_callback
from ..utils.tasks import get_task_manager
@@ -280,7 +281,8 @@ def model_load_progress(
)
try:
yield tracker_context
with force_offline_if_cached(is_cached, model_name):
yield tracker_context
except Exception as e:
# Report error to both managers
progress_manager.mark_error(model_name, str(e))