plc-llm-bench / scripts /dump_cells.py
iulio's picture
Upload folder using huggingface_hub
3bccd69 verified
Raw History Blame Contribute Delete
644 Bytes
import json
from pathlib import Path
root = Path("d:/UsefulNotebooks/plc-llm-bench")
nb_path = root / "PLC_LLM_Bench_Colab.ipynb"
nb = json.loads(nb_path.read_text(encoding="utf-8"))
out = []
for idx, c in enumerate(nb["cells"]):
content = "".join(c.get("source", []))
if idx == 27:
content = content.replace("MODE = 'smoke'", "MODE = 'tier2'")
out.append({
"index": idx,
"type": c["cell_type"],
"content": content
})
dump_path = root / "cells_to_push.json"
dump_path.write_text(json.dumps(out, indent=2, ensure_ascii=False), encoding="utf-8")
print(f"Dumped {len(out)} cells to {dump_path}")