Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Fix installer warning colors on light backgrounds (#13572)

Lee Jackson5c17163f4164
diff --git a/studio/install_python_stack.py b/studio/install_python_stack.py
index a47c5d8e146..56f17b39b28 100644
--- a/studio/install_python_stack.py
+++ b/studio/install_python_stack.py
@@ -7382,8 +7382,8 @@ def _green(msg: str) -> str:
return f"\033[38;5;108m{msg}\033[0m" if _HAS_COLOR else msg
-def _cyan(msg: str) -> str:
- return f"\033[96m{msg}\033[0m" if _HAS_COLOR else msg
+def _warn(msg: str) -> str:
+ return f"\033[38;5;136m{msg}\033[0m" if _HAS_COLOR else msg
def _red(msg: str) -> str:
@@ -8471,7 +8471,7 @@ def _build_flash_attn_wheel_url(env: dict[str, str]) -> str | None:
def _print_optional_install_failure(label: str, result: subprocess.CompletedProcess[str]) -> None:
- _step("warning", f"{label} failed (exit code {result.returncode})", _cyan)
+ _step("warning", f"{label} failed (exit code {result.returncode})", _warn)
if result.stdout:
# Redact any pinned --index-url credentials before printing captured output.
_safe_print(_redact_install_output(result.stdout).strip())
@@ -8515,14 +8515,14 @@ def _remove_stale_flash_attn() -> None:
_step(
"warning",
"flash-attn was built for another torch or CUDA and does not import; removed it",
- _cyan,
+ _warn,
)
else:
_step(
"warning",
"flash-attn was built for another torch or CUDA and could not be removed; "
"uninstall flash-attn manually",
- _cyan,
+ _warn,
)
@@ -8568,7 +8568,7 @@ def _ensure_flash_attn() -> None:
_step(
"warning",
"flash-attn wheel installed but is not importable on this GPU; removed it",
- _cyan,
+ _warn,
)
else:
# the rejected native module remains discoverable and may terminate training.
@@ -8576,26 +8576,26 @@ def _ensure_flash_attn() -> None:
"warning",
"flash-attn wheel is not importable on this GPU and could not be "
"removed; uninstall flash-attn manually before training",
- _cyan,
+ _warn,
)
elif stale:
_remove_stale_flash_attn()
- _step("warning", "Continuing without flash-attn", _cyan)
+ _step("warning", "Continuing without flash-attn", _warn)
return
if wheel_url is None:
if IS_WINDOWS:
_note("no flash-attn prebuilt wheel for this torch build; skipped")
else:
- _step("warning", "No compatible flash-attn prebuilt wheel found", _cyan)
+ _step("warning", "No compatible flash-attn prebuilt wheel found", _warn)
elif wheel_available is None:
_step(
"warning",
"Could not check the flash-attn prebuilt wheel; skipped it",
- _cyan,
+ _warn,
)
else:
- _step("warning", "No published flash-attn prebuilt wheel found", _cyan)
+ _step("warning", "No published flash-attn prebuilt wheel found", _warn)
if stale:
_remove_stale_flash_attn()
@@ -8671,16 +8671,16 @@ def _ensure_ssm_kernels() -> None:
except OSError:
removed = False
if removed:
- _step("warning", f"{name} does not load with this torch; removed it", _cyan)
+ _step("warning", f"{name} does not load with this torch; removed it", _warn)
else:
_step(
"warning",
f"{name} does not load with this torch and could not be removed; "
f"uninstall {distribution} manually",
- _cyan,
+ _warn,
)
elif status:
- _step("warning", f"Continuing without {name}", _cyan)
+ _step("warning", f"Continuing without {name}", _warn)
# -- uv bootstrap ------------------------------------------------------
@@ -10367,7 +10367,7 @@ def _mirror_retry(args: "tuple[str, ...]", output: bytes, rerun) -> "bool | None
_step(
"mirror",
f"{_MIRROR_NAMES[host]} failed; retrying through {next(iter(pairs.values()))}",
- _cyan,
+ _warn,
)
saved = ({name: os.environ.get(name) for name in pairs}, _PYTORCH_WHL_BASE)
os.environ.update(pairs)
@@ -10967,9 +10967,9 @@ def _report_mlx_stack_health(skipped: bool = False) -> None:
if not blockers:
_step("mlx", "training stack ready")
return
- _step("mlx", "Train and Export will stay off until this is resolved:", _cyan)
+ _step("mlx", "Train and Export will stay off until this is resolved:", _warn)
for blocker in blockers:
- _step("", blocker, _cyan)
+ _step("", blocker, _warn)
# The idempotent dependency pass. A skip is legal only when (a) the previous run recorded this
diff --git a/tests/python/test_flash_attn_install_python_stack.py b/tests/python/test_flash_attn_install_python_stack.py
index 78393d53686..e96a79b881b 100644
--- a/tests/python/test_flash_attn_install_python_stack.py
+++ b/tests/python/test_flash_attn_install_python_stack.py
@@ -830,3 +830,17 @@ class TestInstallPythonStackFlashAttnIntegration:
)
== 2
)
+
+
+class TestWarningColor:
+ def test_optional_install_warning_uses_shell_installer_warn_color(self, capsys):
+ import re
+
+ install_sh = (STUDIO_DIR.parent / "install.sh").read_text(encoding = "utf-8")
+ code = re.search(r'C_WARN="\$\{_ESC\}\[([0-9;]+)m"', install_sh).group(1)
+ result = subprocess.CompletedProcess(["uv"], 1, "", "")
+ with mock.patch.object(ips, "_HAS_COLOR", True):
+ ips._print_optional_install_failure("flash-attn install", result)
+ out = capsys.readouterr().out
+ assert f"\033[{code}mflash-attn install failed (exit code 1)\033[0m" in out
+ assert "\033[96m" not in out