Cion-lab commited on
Commit
6cf6f8d
·
verified ·
1 Parent(s): edbcee6

publish_model.py: drop the local 'import shutil' that shadowed the module name and broke Gate 5

Browse files
Files changed (1) hide show
  1. build/publish_model.py +3 -1
build/publish_model.py CHANGED
@@ -261,7 +261,9 @@ def main():
261
  if not need <= have:
262
  raise SystemExit(f"{src} is missing {sorted(need - have)} -- nothing to publish")
263
  if "tokenizer.json" not in have and os.path.exists(os.path.join(a.src, "tokenizer.json")):
264
- import shutil
 
 
265
  shutil.copy(os.path.join(a.src, "tokenizer.json"), src) # ship the tokenizer that cut the mix
266
  have.add("tokenizer.json")
267
  cfg = json.load(open(os.path.join(src, "config.json")))
 
261
  if not need <= have:
262
  raise SystemExit(f"{src} is missing {sorted(need - have)} -- nothing to publish")
263
  if "tokenizer.json" not in have and os.path.exists(os.path.join(a.src, "tokenizer.json")):
264
+ # No `import shutil` here: a module-level name re-imported inside this function makes it *local*
265
+ # to main(), so the verify-only branch's earlier `shutil.rmtree` raised UnboundLocalError and
266
+ # Gate 5 could never run (found by running it, 2026-09-21T13:40Z).
267
  shutil.copy(os.path.join(a.src, "tokenizer.json"), src) # ship the tokenizer that cut the mix
268
  have.add("tokenizer.json")
269
  cfg = json.load(open(os.path.join(src, "config.json")))