fix(studio): name utf-8 when syncing the llama backend marker
sync_marker_llama_backend read and wrote UNSLOTH_PREBUILT_INFO.json without an encoding, so on a stock Windows install both calls use cp1252 and can crash or write mojibake. The sibling helper directly above already passes utf-8. Fixes the Repo tests (CPU) failure on main.
This commit is contained in:
parent
c8bc451d7e
commit
e0a108c1f4
1 changed files with 2 additions and 2 deletions
|
|
@ -5644,7 +5644,7 @@ def sync_marker_llama_backend(install_dir: Path, llama_backend: str | None) -> N
|
|||
"""Sync the persisted llama.cpp backend when the bundle is reused unchanged."""
|
||||
marker_path = install_dir / "UNSLOTH_PREBUILT_INFO.json"
|
||||
try:
|
||||
marker = json.loads(marker_path.read_text())
|
||||
marker = json.loads(marker_path.read_text(encoding = "utf-8"))
|
||||
except (OSError, ValueError):
|
||||
return
|
||||
if not isinstance(marker, dict) or marker.get("llama_backend") == llama_backend:
|
||||
|
|
@ -5653,7 +5653,7 @@ def sync_marker_llama_backend(install_dir: Path, llama_backend: str | None) -> N
|
|||
marker.pop("llama_backend", None)
|
||||
else:
|
||||
marker["llama_backend"] = llama_backend
|
||||
marker_path.write_text(json.dumps(marker, indent = 2) + "\n")
|
||||
marker_path.write_text(json.dumps(marker, indent = 2) + "\n", encoding = "utf-8")
|
||||
log(f"existing install reused; recorded llama_backend={llama_backend!r} from this run")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue