From c2c448684cacdfd5a363dd5df59ef9954ddd5417 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 24 May 2026 14:06:23 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- studio/backend/core/inference/llama_cpp.py | 1 + studio/backend/tests/test_llama_cpp_reprompt_guard.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/studio/backend/core/inference/llama_cpp.py b/studio/backend/core/inference/llama_cpp.py index 6995df4f41..f9e66d4945 100644 --- a/studio/backend/core/inference/llama_cpp.py +++ b/studio/backend/core/inference/llama_cpp.py @@ -134,6 +134,7 @@ def _has_answer_artifact(text: str) -> bool: return _PLAN_LIST_FRAMING.search(text) is None return False + # Without max_tokens, llama-server defaults to n_predict = n_ctx (up to # 262144 for Qwen3.5), producing many-minute zombie decodes when cancel # fails. t_max_predict_ms is a wall-clock backstop applied unconditionally, diff --git a/studio/backend/tests/test_llama_cpp_reprompt_guard.py b/studio/backend/tests/test_llama_cpp_reprompt_guard.py index 49954918f0..f750023a40 100644 --- a/studio/backend/tests/test_llama_cpp_reprompt_guard.py +++ b/studio/backend/tests/test_llama_cpp_reprompt_guard.py @@ -103,8 +103,8 @@ def test_artifact_regex_detects_non_alpha_info_strings(): samples = [ "First, let me write it.\n```python3\nprint('hi')\n```", "First, let me write it.\n```c++\nint main() { return 0; }\n```", - "First, let me write it.\n```c#\nConsole.WriteLine(\"hi\");\n```", - "First, let me write it.\n```objective-c\nNSLog(@\"hi\");\n```", + 'First, let me write it.\n```c#\nConsole.WriteLine("hi");\n```', + 'First, let me write it.\n```objective-c\nNSLog(@"hi");\n```', "First, let me write it.\n```ts-node\nconsole.log('hi')\n```", "First, let me script it.\n```bash-session\n$ echo hi\n```", "First, let me show it.\n```python linenums=\"1\"\nprint('hi')\n```",