From a3e942516c04c26292a6b24e60f677587c30bb50 Mon Sep 17 00:00:00 2001 From: tt1203 <42492960+tt1203@users.noreply.github.com> Date: Thu, 16 Jul 2026 14:52:16 +0100 Subject: [PATCH] fix(oracle): create glm_tiny/ before saving so a fresh checkout works MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit make_glm_oracle.py wrote glm_tiny/model.safetensors and glm_tiny/config.json without creating the directory first. safetensors.save_file writes a temp file inside the target dir before the atomic rename, so on a clean checkout (no pre-existing glm_tiny/) it aborts with an opaque error: SafetensorError: Error while serializing: I/O error: The system cannot find the path specified. (os error 3) at path ".../glm_tiny/.tmpXXXXXX" The directory only ever existed because it was left over from a previous run, so the first-ever `python tools/make_glm_oracle.py` fails for every new user following the README's verify step. Create glm_tiny/ with Path.mkdir(parents=True, exist_ok=True) before the save branch — covers the fp8 path, the bf16 path, and config.json. Path is already imported; no new dependency, no change to the CPU build. --- c/tools/make_glm_oracle.py | 1 + 1 file changed, 1 insertion(+) diff --git a/c/tools/make_glm_oracle.py b/c/tools/make_glm_oracle.py index b623faf..521baf6 100644 --- a/c/tools/make_glm_oracle.py +++ b/c/tools/make_glm_oracle.py @@ -115,6 +115,7 @@ print("tf_pred:", tf_pred) sd = model.state_dict() unfuse_experts(sd) +Path("glm_tiny").mkdir(parents=True, exist_ok=True) # safetensors/json won't create the dir themselves if args.fp8: n_fp8, n_tot = save_fp8_safetensors(sd, "glm_tiny/model.safetensors") print(f"\nsaved FP8: {n_fp8} e4m3 tensors (+{n_tot - n_fp8} scale_inv sidecars / f32) "