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(studio): avoid UnicodeEncodeError on Windows cp1252 consoles (#4699)

Daniel Han6d83ad9a2834
diff --git a/studio/backend/run.py b/studio/backend/run.py
index 18babf6229b..9c3622988e5 100644
--- a/studio/backend/run.py
+++ b/studio/backend/run.py
@@ -312,10 +312,10 @@ def run_server(
if frontend_path:
if setup_frontend(app, frontend_path):
if not silent:
- print(f"✅ Frontend loaded from {frontend_path}")
+ print(f"[OK] Frontend loaded from {frontend_path}")
else:
if not silent:
- print(f"⚠️ Frontend not found at {frontend_path}")
+ print(f"[WARNING] Frontend not found at {frontend_path}")
# Create the uvicorn server and expose it for signal handlers
config = uvicorn.Config(
diff --git a/studio/backend/utils/datasets/format_conversion.py b/studio/backend/utils/datasets/format_conversion.py
index 39f0113fe0b..289b30e55ea 100644
--- a/studio/backend/utils/datasets/format_conversion.py
+++ b/studio/backend/utils/datasets/format_conversion.py
@@ -553,13 +553,9 @@ def convert_to_vlm_format(
batch_results[idx] = future.result()
except Exception as e:
failed_count += 1
- if failed_count == 1:
- print(
- f"⚠️ First VLM conversion failure: {type(e).__name__}: {e}"
- )
if failed_count == 1:
logger.info(
- f"⚠️ First VLM conversion failure: {type(e).__name__}: {e}"
+ f"First VLM conversion failure: {type(e).__name__}: {e}"
)
converted_list.extend(r for r in batch_results if r is not None)
@@ -583,13 +579,10 @@ def convert_to_vlm_format(
converted_list.append(_convert_single_sample(sample))
except Exception as e:
failed_count += 1
- if failed_count == 1:
- # Log the first failure to aid debugging
- print(f"⚠️ First VLM conversion failure: {type(e).__name__}: {e}")
if failed_count == 1:
# Log the first failure to aid debugging
logger.info(
- f"⚠️ First VLM conversion failure: {type(e).__name__}: {e}"
+ f"First VLM conversion failure: {type(e).__name__}: {e}"
)
pbar.set_postfix(ok = len(converted_list), failed = failed_count, refresh = False)
pbar.close()
diff --git a/studio/setup.ps1 b/studio/setup.ps1
index 6e19fbea830..7cea60371af 100644
--- a/studio/setup.ps1
+++ b/studio/setup.ps1
@@ -1522,8 +1522,14 @@ if ($CuTag -eq "cpu") {
# Ordered heavy dependency installation -- shared cross-platform script
substep "running ordered dependency installation..."
python "$PSScriptRoot\install_python_stack.py"
+$stackExit = $LASTEXITCODE
# Restore ErrorActionPreference after pip/python work
$ErrorActionPreference = $prevEAP
+if ($stackExit -ne 0) {
+ Write-Host "[FAILED] Python dependency installation failed (exit code $stackExit)" -ForegroundColor Red
+ Write-Host " Re-run the installer or check the error above for details." -ForegroundColor Red
+ exit 1
+}
# ── Pre-install transformers 5.x into .venv_t5/ ──
# Models like GLM-4.7-Flash need transformers>=5.3.0. Instead of pip-installing