[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2026-07-26 14:46:49 +00:00
commit 64e2b173b8
4 changed files with 5 additions and 3 deletions

View file

@ -369,6 +369,7 @@ def dit_accelerator_missing_reason(resolved_family: str) -> Optional[str]:
return None
try:
import torch
xpu = getattr(torch, "xpu", None)
mps = getattr(torch, "mps", None)
if (

View file

@ -4614,9 +4614,11 @@ async def _load_model_impl(
# requirement exactly as it does for the load.
if config.is_gguf and config.gguf_hf_repo:
from core.inference.llama_cpp import gguf_load_in_flight
gguf_load_stack.enter_context(gguf_load_in_flight(config.gguf_hf_repo))
from core.inference.llama_cpp import _hub_download_blocks_gguf_load
if await asyncio.to_thread(
_hub_download_blocks_gguf_load,
config.gguf_hf_repo,

View file

@ -621,6 +621,7 @@ def test_assert_trusted_base_model_rejects_local_non_pipeline(tmp_path):
with pytest.raises(ValueError, match = "untrusted"):
common._assert_trusted_base_model("evil/base")
def test_dit_accelerator_missing_reason_and_info_hide_train_without_a_gpu(monkeypatch):
# Clicking Start on a GPU-less host evicted the resident Images pipeline, downloaded the text
# encoders, and only then died in the child: diffusers' bitsandbytes quantizer refuses 4-bit

View file

@ -1151,9 +1151,7 @@ class TestRouteErrors(unittest.TestCase):
patch.object(inference_route.asyncio, "to_thread", new = _inline_to_thread),
patch.object(inference_route, "_hf_offline_if_dns_dead", nullcontext),
# The chat handoff passes a `register` hook (the in-flight marker), so accept it.
patch.object(
arb, "acquire_for", lambda owner, register = None: acquired.append(owner)
),
patch.object(arb, "acquire_for", lambda owner, register = None: acquired.append(owner)),
):
with self.assertRaises(HTTPException) as exc_info:
asyncio.run(