Download scripts/export_messages.py from jumplander/JumpForge-Agentic-SE-3K: direct link, hf CLI and curl.
- Browser
- Download file 455 Bytes
-
https://huggingface.co/datasets/jumplander/JumpForge-Agentic-SE-3K/resolve/main/scripts/export_messages.py
- Command line
-
hf download hf://datasets/jumplander/JumpForge-Agentic-SE-3K/scripts/export_messages.py
-
curl -L -o export_messages.py https://huggingface.co/datasets/jumplander/JumpForge-Agentic-SE-3K/resolve/main/scripts/export_messages.py
455 Bytes
| #!/usr/bin/env python3 | |
| import json | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| source = ROOT / "data" / "all.jsonl" | |
| target = ROOT / "data" / "messages_sft.jsonl" | |
| with source.open(encoding="utf-8") as src, target.open("w", encoding="utf-8") as dst: | |
| for line in src: | |
| record = json.loads(line) | |
| dst.write(json.dumps({"id": record["id"], "messages": record["messages"]}, ensure_ascii=False) + "\n") | |
| print(target) | |