AdithyaSK HF Staff commited on
Commit
cc0a03c
·
verified ·
1 Parent(s): 8a07c0f

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +53 -49
README.md CHANGED
@@ -1,51 +1,55 @@
1
  ---
2
- dataset_info:
3
- features:
4
- - name: task_id
5
- dtype: string
6
- - name: difficulty
7
- dtype: int64
8
- - name: difficulty_tier
9
- dtype: string
10
- - name: n_turns
11
- dtype: int64
12
- - name: source_agent
13
- dtype: string
14
- - name: messages
15
- list: json
16
- - name: tools
17
- list:
18
- - name: type
19
- dtype: string
20
- - name: function
21
- struct:
22
- - name: name
23
- dtype: string
24
- - name: description
25
- dtype: string
26
- - name: parameters
27
- struct:
28
- - name: type
29
- dtype: string
30
- - name: properties
31
- struct:
32
- - name: command
33
- struct:
34
- - name: type
35
- dtype: string
36
- - name: description
37
- dtype: string
38
- - name: required
39
- list: string
40
- splits:
41
- - name: train
42
- num_bytes: 29097476
43
- num_examples: 4677
44
- download_size: 28918861
45
- dataset_size: 29097476
46
- configs:
47
- - config_name: default
48
- data_files:
49
- - split: train
50
- path: data/train-*
51
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: mit
3
+ task_categories:
4
+ - text-generation
5
+ tags:
6
+ - sft
7
+ - agent
8
+ - tool-calling
9
+ - data-analysis
10
+ - trl
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  ---
12
+
13
+ # 🛠️ Data Agent — SFT
14
+
15
+ **4,677 worked examples** of an agent doing data science *the right way*. Each row is a complete,
16
+ **verified-correct** trajectory: read the question, poke at the data with a shell tool, reason,
17
+ compute, and write the answer. Every one of these solved its task and passed a deterministic grader
18
+ — so you're fine-tuning on demonstrations that are **known to be correct**, not just plausible.
19
+
20
+ Drop-in ready for [TRL](https://github.com/huggingface/trl): conversational `messages` + `tools`.
21
+
22
+ ## Where it comes from
23
+ These are real agent rollouts on the [Data Agent](https://huggingface.co/HuggingEnvs) tasks, which
24
+ were themselves built from the [**jupyter-agent dataset**](https://huggingface.co/datasets/jupyter-agent/jupyter-agent-dataset)
25
+ (data-science notebooks over Kaggle datasets). We kept **only trajectories that reached the correct
26
+ answer** under deterministic grading (reward = 1.0) — one clean demonstration per task.
27
+
28
+ ## What's inside
29
+ - **4,677 correct trajectories** — one per task
30
+ - **Difficulty** — easy 1,402 · medium 2,640 · hard 635
31
+ - One tool throughout: `bash` (shell command execution)
32
+
33
+ ## What's in a row
34
+ - **`messages`** — the full conversation in OpenAI/TRL chat format: `system` → `user` (the task) →
35
+ `assistant` (reasoning + `tool_calls`) → `tool` (command output) → … → final `assistant` answer.
36
+ Tool-call `arguments` are JSON objects; `tool` messages carry the tool `name`.
37
+ - **`tools`** — the `bash` tool's JSON schema (rendered by `apply_chat_template(..., tools=...)`)
38
+ - `task_id`, `difficulty` (1–5), `difficulty_tier`, `n_turns`, `source_agent`
39
+
40
+ ## Fine-tune with TRL
41
+ ```python
42
+ from datasets import load_dataset
43
+ from trl import SFTTrainer, SFTConfig
44
+
45
+ ds = load_dataset("HuggingEnvs/data-agent-sft", split="train")
46
+
47
+ trainer = SFTTrainer(
48
+ model="Qwen/Qwen2.5-3B-Instruct", # any tool-capable chat template
49
+ train_dataset=ds, # messages + tools are picked up automatically
50
+ args=SFTConfig(assistant_only_loss=True, max_length=8192),
51
+ )
52
+ trainer.train()
53
+ ```
54
+ The `messages` + `tools` columns render through your model's chat template, and
55
+ `assistant_only_loss=True` trains on the assistant's tokens only — no dataset wrangling needed.