From 8858104b29e77ffd0b705d1d4f218d30f9b1b5ba Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 May 2026 01:05:45 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- studio/backend/models/inference.py | 4 ++-- studio/backend/routes/training.py | 4 +--- studio/backend/tests/test_diffusion_routes.py | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/studio/backend/models/inference.py b/studio/backend/models/inference.py index 94b2d6232d..2767474e5f 100644 --- a/studio/backend/models/inference.py +++ b/studio/backend/models/inference.py @@ -1491,8 +1491,8 @@ class DiffusionLoadRequest(BaseModel): # in the C++ layer. uint64 is also routinely cited online so accept # any value the underlying RNG could store and bounce the rest at the # Pydantic layer with a clean error. -_SEED_MIN = -(2 ** 63) -_SEED_MAX = (2 ** 64) - 1 +_SEED_MIN = -(2**63) +_SEED_MAX = (2**64) - 1 class DiffusionGenerateRequest(BaseModel): diff --git a/studio/backend/routes/training.py b/studio/backend/routes/training.py index 38f4108d25..0715a79c66 100644 --- a/studio/backend/routes/training.py +++ b/studio/backend/routes/training.py @@ -292,9 +292,7 @@ async def start_training( llama_backend = get_llama_cpp_backend() if getattr(llama_backend, "is_loaded", False): - logger.info( - "Unloading GGUF chat model to free GPU memory for training" - ) + logger.info("Unloading GGUF chat model to free GPU memory for training") llama_backend.unload_model() except Exception as e: logger.warning("Could not unload GGUF chat model: %s", e) diff --git a/studio/backend/tests/test_diffusion_routes.py b/studio/backend/tests/test_diffusion_routes.py index 39dd28c88a..9d21f0af0b 100644 --- a/studio/backend/tests/test_diffusion_routes.py +++ b/studio/backend/tests/test_diffusion_routes.py @@ -217,7 +217,7 @@ def test_generate_rejects_oversize_seed(app_with_stub): ) r = c.post( "/api/inference/images/generate", - json = {"prompt": "x", "seed": 2 ** 100}, + json = {"prompt": "x", "seed": 2**100}, ) assert r.status_code == 422, r.text @@ -234,7 +234,7 @@ def test_generate_accepts_uint64_max_seed(app_with_stub): ) r = c.post( "/api/inference/images/generate", - json = {"prompt": "x", "seed": (2 ** 64) - 1}, + json = {"prompt": "x", "seed": (2**64) - 1}, ) # The fake backend returns 200 on success; we only care that the # request did NOT 422 on seed bounds.