From 9af17e2aa58f05b2256b63cf6173d10bf29fb0f7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 10 Jun 2026 06:13:15 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- studio/backend/core/training/worker.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/studio/backend/core/training/worker.py b/studio/backend/core/training/worker.py index 15f9e6ff51..317b2301f8 100644 --- a/studio/backend/core/training/worker.py +++ b/studio/backend/core/training/worker.py @@ -2246,11 +2246,14 @@ def run_training_process(*, event_queue: Any, stop_queue: Any, config: dict) -> # UNSLOTH_NO_EXPANDABLE_SEGMENTS opt-out semantics as the library patch. try: import platform as _plat + _spark_smi = False if _plat.machine().lower() in ("aarch64", "arm64"): _smi = _sp.run( ["nvidia-smi", "--query-gpu=name", "--format=csv,noheader"], - capture_output = True, text = True, timeout = 5, + capture_output = True, + text = True, + timeout = 5, ) _names_u = (_smi.stdout or "").upper() _spark_smi = any( @@ -2260,8 +2263,8 @@ def run_training_process(*, event_queue: Any, stop_queue: Any, config: dict) -> _conf = os.environ.get("PYTORCH_CUDA_ALLOC_CONF", "") if "expandable_segments" not in _conf: os.environ["PYTORCH_CUDA_ALLOC_CONF"] = ( - (_conf + "," if _conf else "") + "expandable_segments:True" - ) + _conf + "," if _conf else "" + ) + "expandable_segments:True" except Exception: pass import torch as _torch_mem