diff --git a/studio/backend/tests/test_offline_gguf_cache_fallback.py b/studio/backend/tests/test_offline_gguf_cache_fallback.py index 3c62fb7964..3240c2dc5e 100644 --- a/studio/backend/tests/test_offline_gguf_cache_fallback.py +++ b/studio/backend/tests/test_offline_gguf_cache_fallback.py @@ -1039,7 +1039,6 @@ class TestEndpointAwareOfflineDetection: ) def test_endpoint_host_parsing(self, monkeypatch, endpoint, expected): from core.inference.llama_cpp import _hf_endpoint_host - monkeypatch.setenv("HF_ENDPOINT", endpoint) assert _hf_endpoint_host() == expected @@ -1147,7 +1146,6 @@ class TestHfUnreachableProbe: """Stale either way is a bug: a stale 'reachable' hides the plug being pulled, a stale 'unreachable' fails a download after the user reconnects.""" import utils.utils as uu - assert uu._HF_REACHABILITY_TTL_S <= 10.0 def test_verdict_expires_so_a_disconnect_is_noticed(self, monkeypatch, clean_offline_env): diff --git a/studio/backend/utils/transformers_version.py b/studio/backend/utils/transformers_version.py index bbc51d0774..34576decc2 100644 --- a/studio/backend/utils/transformers_version.py +++ b/studio/backend/utils/transformers_version.py @@ -90,7 +90,9 @@ def hf_endpoint_unreachable(timeout: int = 3, *, gateway_errors_offline: bool = # the hub itself is down, which callers scoping offline to one operation want # to treat as offline; callers setting a lifetime flag pass # gateway_errors_offline=False so a momentary 503 can't strand the process. - result["online"] = True if not gateway_errors_offline else exc.code not in (502, 503, 504) + result["online"] = ( + True if not gateway_errors_offline else exc.code not in (502, 503, 504) + ) except urllib.error.URLError as exc: # A TLS/cert failure means we DID reach the server; treat as reachable so the real # load surfaces it (consistent with _is_offline_related_error not retrying TLS).