From 1ec30c54d1f946523006eebc4eb1186e41ab005a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 05:34:19 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- studio/backend/tests/test_offline_gguf_cache_fallback.py | 2 -- studio/backend/utils/transformers_version.py | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) 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).