diff --git a/studio/backend/main.py b/studio/backend/main.py index 2b34b11fef..064e261753 100644 --- a/studio/backend/main.py +++ b/studio/backend/main.py @@ -193,6 +193,11 @@ if _STUDIO_ROOT_RESOLVED != _LEGACY_STUDIO_ROOT: if not os.environ.get("UNSLOTH_LLAMA_CPP_PATH"): os.environ["UNSLOTH_LLAMA_CPP_PATH"] = str(_STUDIO_ROOT_RESOLVED / "llama.cpp") +# The studio bundles unsloth_zoo; declare unsloth present (as `import unsloth` +# does) so its lazy submodule imports (export, hardware, mlx) and the +# DiffusionGemma runner never trip the install guard on a clean install. +os.environ.setdefault("UNSLOTH_IS_PRESENT", "1") + import hashlib import mimetypes import re as _re diff --git a/studio/backend/run.py b/studio/backend/run.py index a883154c4a..a8e9a46a66 100644 --- a/studio/backend/run.py +++ b/studio/backend/run.py @@ -545,6 +545,11 @@ if _STUDIO_ROOT_RESOLVED != _LEGACY_STUDIO_ROOT: if not os.environ.get("UNSLOTH_LLAMA_CPP_PATH"): os.environ["UNSLOTH_LLAMA_CPP_PATH"] = str(_STUDIO_ROOT_RESOLVED / "llama.cpp") +# The studio bundles unsloth_zoo; declare unsloth present (as `import unsloth` +# does) so its lazy submodule imports (export, hardware, mlx) and the +# DiffusionGemma runner never trip the install guard on a clean install. +os.environ.setdefault("UNSLOTH_IS_PRESENT", "1") + def _write_pid_file(): """Write the current process PID to the studio PID file."""