diff --git a/studio/backend/utils/hardware/amd.py b/studio/backend/utils/hardware/amd.py index 747c515d68..d71f1cd494 100644 --- a/studio/backend/utils/hardware/amd.py +++ b/studio/backend/utils/hardware/amd.py @@ -89,7 +89,9 @@ def _parse_memory_mb(value: Any) -> Optional[float]: return num if "kib" in unit or "kb" in unit: return num / 1024 - if unit and ("b" in unit and "g" not in unit and "m" not in unit and "k" not in unit): + if unit and ( + "b" in unit and "g" not in unit and "m" not in unit and "k" not in unit + ): # Plain bytes return num / (1024 * 1024) diff --git a/studio/backend/utils/hardware/hardware.py b/studio/backend/utils/hardware/hardware.py index 4e9214deda..a31a389753 100644 --- a/studio/backend/utils/hardware/hardware.py +++ b/studio/backend/utils/hardware/hardware.py @@ -43,7 +43,9 @@ class DeviceType(str, Enum): DEVICE: Optional[DeviceType] = None CHAT_ONLY: bool = True # No CUDA GPU -> GGUF chat only (Mac, CPU-only, etc.) -IS_ROCM: bool = False # True when running on AMD ROCm (HIP) -- routes GPU monitoring to amd.py +IS_ROCM: bool = ( + False # True when running on AMD ROCm (HIP) -- routes GPU monitoring to amd.py +) # ========== Detection ========== @@ -572,9 +574,8 @@ def _get_parent_visible_gpu_spec() -> Dict[str, Any]: # env vars first so multi-GPU AMD setups are handled correctly. cuda_visible = None if IS_ROCM: - cuda_visible = ( - os.environ.get("HIP_VISIBLE_DEVICES") - or os.environ.get("ROCR_VISIBLE_DEVICES") + cuda_visible = os.environ.get("HIP_VISIBLE_DEVICES") or os.environ.get( + "ROCR_VISIBLE_DEVICES" ) if cuda_visible is None: cuda_visible = os.environ.get("CUDA_VISIBLE_DEVICES") diff --git a/studio/install_python_stack.py b/studio/install_python_stack.py index e884134a73..9f3c3ddd04 100644 --- a/studio/install_python_stack.py +++ b/studio/install_python_stack.py @@ -738,10 +738,10 @@ def install_python_stack() -> int: try: _wr = subprocess.run( [_wexe, *_wcmd[1:]], - stdout=subprocess.PIPE, - stderr=subprocess.DEVNULL, - text=True, - timeout=10, + stdout = subprocess.PIPE, + stderr = subprocess.DEVNULL, + text = True, + timeout = 10, ) except Exception: continue