From 874711912dfd89b7b62db77fbbb9bc0cc90ec8a6 Mon Sep 17 00:00:00 2001 From: Roland Tannous <115670425+rolandtannous@users.noreply.github.com> Date: Thu, 12 Mar 2026 17:28:08 +0400 Subject: [PATCH] Update studio.py --- cli/commands/studio.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cli/commands/studio.py b/cli/commands/studio.py index 45b2e4fd13..c13de30ba0 100644 --- a/cli/commands/studio.py +++ b/cli/commands/studio.py @@ -294,7 +294,13 @@ def _build_llama_cpp(): typer.echo(" Building llama.cpp for GGUF inference...") if llama_dir.exists(): - shutil.rmtree(llama_dir) + # necessary because shutil.rmtree fails on Windows because .git pack files are read-only + def _force_remove_readonly(func, path, exc_info): + """Clear read-only flag and retry — needed on Windows for .git pack files.""" + import stat + os.chmod(path, stat.S_IWRITE) + func(path) + shutil.rmtree(llama_dir, onerror=_force_remove_readonly) unsloth_home.mkdir(parents = True, exist_ok = True) result = subprocess.run(