* Replace standalone Studio wording with Unsloth Replace the single word Studio with Unsloth wherever it is used as shorthand for Unsloth Studio in docs, CLI output, UI strings, i18n locales, workflow display names, comments and docstrings. Kept unchanged: the full name Unsloth Studio, third party product names (LM Studio, Visual Studio, Mac Studio), feature names (Recipe Studio, Fine-tuning Studio and its translations), and all identifiers such as env vars, commands, paths and filenames. * Address review feedback on the Studio wording rename Use "an" before Unsloth where the rename left the article as "a". Restore the split brand where Unsloth and Studio render as two halves of the full product name: the onboarding sidebar subtitle and the IPv6 localhost warning. Scope two messages to the full name Unsloth Studio where plain Unsloth was misleading: the AMD README bullet and the CLI studio setup error.
42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
"""Timeout policy checks for Unsloth's local llama-server path."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import ast
|
|
from pathlib import Path
|
|
|
|
|
|
SOURCE_PATH = (
|
|
Path(__file__).resolve().parents[2]
|
|
/ "studio"
|
|
/ "backend"
|
|
/ "core"
|
|
/ "inference"
|
|
/ "llama_cpp.py"
|
|
)
|
|
SRC = SOURCE_PATH.read_text()
|
|
TREE = ast.parse(SRC)
|
|
|
|
|
|
def _module_constant(name: str):
|
|
for node in TREE.body:
|
|
if isinstance(node, ast.Assign) and len(node.targets) == 1:
|
|
t = node.targets[0]
|
|
if isinstance(t, ast.Name) and t.id == name:
|
|
value = node.value
|
|
assert isinstance(value, ast.Constant)
|
|
return value.value
|
|
raise AssertionError(f"{name} constant missing")
|
|
|
|
|
|
def test_first_token_timeout_is_at_least_twenty_minutes():
|
|
value = _module_constant("_DEFAULT_FIRST_TOKEN_TIMEOUT_S")
|
|
assert value >= 1200.0
|
|
|
|
|
|
def test_studio_chat_payloads_do_not_set_wall_clock_generation_cap():
|
|
assert "t_max_predict_ms" not in SRC
|
|
|
|
|
|
def test_max_tokens_default_cap_still_applied():
|
|
assert SRC.count("_DEFAULT_MAX_TOKENS_FLOOR") >= 3
|