From de3032eb07a6fe94f749f14db2e9da536eba8465 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 14:36:25 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- studio/backend/routes/inference.py | 7 +++++-- .../test_inference_defaults_chat_template_kwargs.py | 12 +++--------- .../tests/test_passthrough_chat_template_kwargs.py | 8 ++------ 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/studio/backend/routes/inference.py b/studio/backend/routes/inference.py index 4d23e73df1..c61479034c 100644 --- a/studio/backend/routes/inference.py +++ b/studio/backend/routes/inference.py @@ -5318,7 +5318,9 @@ def _extract_response_format(payload): def _build_openai_passthrough_body( - payload, backend_ctx = None, model_identifier: str | None = None, + payload, + backend_ctx = None, + model_identifier: str | None = None, ) -> dict: """Assemble the llama-server request body from a ChatCompletionRequest. @@ -5346,7 +5348,8 @@ def _build_openai_passthrough_body( except Exception as exc: logger.warning( "openai_passthrough.family_defaults_lookup_failed model=%s err=%s", - model_identifier, exc, + model_identifier, + exc, ) # Per-request enable_thinking already lifted from extra_body upstream. if payload.enable_thinking is not None: diff --git a/studio/backend/tests/test_inference_defaults_chat_template_kwargs.py b/studio/backend/tests/test_inference_defaults_chat_template_kwargs.py index e9ac216dd6..4e54bf562d 100644 --- a/studio/backend/tests/test_inference_defaults_chat_template_kwargs.py +++ b/studio/backend/tests/test_inference_defaults_chat_template_kwargs.py @@ -45,9 +45,7 @@ class TestLoadInferenceConfig: assert cfg["chat_template_kwargs"] == {"reasoning_effort": "medium"} def test_nemotron_load_surfaces_dict(self): - cfg = load_inference_config( - "unsloth/NVIDIA-Nemotron-3-Super-120B-A12B-GGUF" - ) + cfg = load_inference_config("unsloth/NVIDIA-Nemotron-3-Super-120B-A12B-GGUF") assert cfg["chat_template_kwargs"] == {"enable_thinking": True} def test_qwen3_load_returns_none_for_kwargs(self): @@ -73,14 +71,10 @@ class TestLoadInferenceConfig: class TestTemperatureBumps: def test_devstral_temperature_lowered_to_card_value(self): # Devstral-Small-2 card recommends T=0.15. - cfg = load_inference_config( - "unsloth/Devstral-Small-2-24B-Instruct-2512-GGUF" - ) + cfg = load_inference_config("unsloth/Devstral-Small-2-24B-Instruct-2512-GGUF") assert cfg["temperature"] == 0.15 def test_ministral_temperature_below_one_tenth(self): # Ministral-3 card says "temperature below 0.1 for production". - cfg = load_inference_config( - "unsloth/Ministral-3-8B-Instruct-2512-GGUF" - ) + cfg = load_inference_config("unsloth/Ministral-3-8B-Instruct-2512-GGUF") assert cfg["temperature"] < 0.1 diff --git a/studio/backend/tests/test_passthrough_chat_template_kwargs.py b/studio/backend/tests/test_passthrough_chat_template_kwargs.py index 2d1d4043fb..15eca30a40 100644 --- a/studio/backend/tests/test_passthrough_chat_template_kwargs.py +++ b/studio/backend/tests/test_passthrough_chat_template_kwargs.py @@ -32,9 +32,7 @@ class TestFamilyDefaults: body = _build_openai_passthrough_body( payload, model_identifier = "unsloth/gpt-oss-120b-GGUF" ) - assert body.get("chat_template_kwargs") == { - "reasoning_effort": "medium" - } + assert body.get("chat_template_kwargs") == {"reasoning_effort": "medium"} def test_nemotron_family_default_reaches_outbound(self): payload = _make_payload() @@ -67,9 +65,7 @@ class TestPerRequestOverrides: assert body["chat_template_kwargs"]["reasoning_effort"] == "high" def test_extra_body_chat_template_kwargs_wins_outright(self): - payload = _make_payload( - chat_template_kwargs = {"reasoning_effort": "low"} - ) + payload = _make_payload(chat_template_kwargs = {"reasoning_effort": "low"}) body = _build_openai_passthrough_body( payload, model_identifier = "unsloth/gpt-oss-120b-GGUF" )