Louistiti commited on
Commit
5302887
·
verified ·
1 Parent(s): 13e5e7d

fix: explicitly configure lossless training dataset viewer

Browse files
Files changed (3) hide show
  1. README.md +7 -0
  2. prepare_viewer.py +18 -0
  3. viewer_train.jsonl +0 -0
README.md CHANGED
@@ -10,6 +10,11 @@ size_categories:
10
  - n<1K
11
  task_categories:
12
  - text-generation
 
 
 
 
 
13
  ---
14
  # Python Repair Lab
15
 
@@ -52,4 +57,6 @@ requirements.txt locks dependencies from a Python 3.11 environment. Local checks
52
 
53
  ## Dataset and provenance
54
 
 
 
55
  All task instructions, starters, generators and reference implementations were created for this repository. No imported benchmark or private evaluation data is included. tasks.jsonl has one training task per line with task_id, prompt, starter, executable argument/expected-value cases and split. See generate_tasks.py for seed 20261008 and task construction, server.py for rewards, solutions.json for the oracle and replay.py for runtime verification. All repository code/data are MIT-licensed; OpenEnv is a separate BSD-3-Clause dependency. This is synthetic programming data with no personal information.
 
10
  - n<1K
11
  task_categories:
12
  - text-generation
13
+ configs:
14
+ - config_name: default
15
+ data_files:
16
+ - split: train
17
+ path: viewer_train.jsonl
18
  ---
19
  # Python Repair Lab
20
 
 
57
 
58
  ## Dataset and provenance
59
 
60
+ The dataset viewer explicitly loads `viewer_train.jsonl` as the `train` split, rather than inferring splits from the repository's test code or validation reports. It contains the same 12 tasks and 1,055 cases as canonical `tasks.jsonl`. Each row has task_id, prompt, starter, split, num_cases and cases_json. `cases_json` is a lossless JSON string because different tasks use different nested argument and answer types; decode it with `json.loads`. Run `python prepare_viewer.py` to regenerate the viewer file. The canonical executable task files remain unchanged.
61
+
62
  All task instructions, starters, generators and reference implementations were created for this repository. No imported benchmark or private evaluation data is included. tasks.jsonl has one training task per line with task_id, prompt, starter, executable argument/expected-value cases and split. See generate_tasks.py for seed 20261008 and task construction, server.py for rewards, solutions.json for the oracle and replay.py for runtime verification. All repository code/data are MIT-licensed; OpenEnv is a separate BSD-3-Clause dependency. This is synthetic programming data with no personal information.
prepare_viewer.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Create Arrow-friendly dataset rows without changing canonical task data."""
2
+ import json
3
+ from pathlib import Path
4
+
5
+ ROOT = Path(__file__).resolve().parent
6
+ rows = [json.loads(line) for line in (ROOT / "tasks.jsonl").read_text().splitlines() if line]
7
+ viewer = []
8
+ for task in rows:
9
+ row = {key: task[key] for key in ("task_id", "prompt", "starter", "split")}
10
+ row["num_cases"] = len(task["cases"])
11
+ row["cases_json"] = json.dumps(task["cases"], ensure_ascii=False, separators=(",", ":"))
12
+ assert json.loads(row["cases_json"]) == task["cases"]
13
+ viewer.append(row)
14
+ assert len({row["task_id"] for row in viewer}) == len(rows)
15
+ (ROOT / "viewer_train.jsonl").write_text(
16
+ "".join(json.dumps(row, ensure_ascii=False) + "\n" for row in viewer)
17
+ )
18
+ print(f"Prepared {len(viewer)} rows, {sum(row['num_cases'] for row in viewer)} cases")
viewer_train.jsonl ADDED
The diff for this file is too large to render. See raw diff