11-47 commited on
Commit
ed30b20
·
0 Parent(s):

Super-squash branch 'main' using huggingface_hub

Browse files
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ library_name: transformers
5
+ pipeline_tag: text-generation
6
+ base_model: WithinUsAI/WIUAI.Mini.Coder.ToolCalling
7
+ datasets:
8
+ - greghavens/fable-5-coding-and-debugging-traces
9
+ - greghavens/gpt-5.6-sol-coding-and-debugging-traces
10
+ - greghavens/glm-5.2-coding-and-debugging-traces
11
+ tags:
12
+ - coding
13
+ - debugging
14
+ - agentic
15
+ - traces
16
+ - chatml
17
+ - full-fine-tune
18
+ - withinusai
19
+ ---
20
+
21
+ # WIUAI.Mini.Coder.Traces
22
+
23
+ Full fine-tune of [WithinUsAI/WIUAI.Mini.Coder.ToolCalling](https://huggingface.co/WithinUsAI/WIUAI.Mini.Coder.ToolCalling) on coding and debugging agent-trace datasets by
24
+ greghavens (listed below). Published by WithinUsAI.
25
+
26
+ > **Status:** checkpoint at **step 233 of 233** (epoch 1.00 of 1). This README and the weights are
27
+ > replaced automatically at every checkpoint, so the repo always holds one complete, latest model.
28
+ > Elapsed training time so far: 66 min. No task benchmark has been run.
29
+
30
+ ## Prompt format
31
+
32
+ ChatML written as plain text: `<|im_start|>role\n...<|im_end|>\n` with roles system, user, assistant, tool. Tool calls are written as
33
+ `<tool_call>` JSON `</tool_call>` and tool results as `<tool_response>` blocks. In this tokenizer `<|im_start|>` and `<|im_end|>`
34
+ are ordinary text, not single tokens. Stop generation with a stop string and cut the output at the first `<|im_end|>`.
35
+
36
+ ```python
37
+ import torch
38
+ from transformers import AutoTokenizer, AutoModelForCausalLM
39
+ repo = "WithinUsAI/WIUAI.Mini.Coder.Traces"
40
+ tok = AutoTokenizer.from_pretrained(repo)
41
+ model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.float16, device_map="auto")
42
+ prompt = ("<|im_start|>system\nYou are a coding agent.<|im_end|>\n"
43
+ "<|im_start|>user\n" + USER_MESSAGE + "<|im_end|>\n"
44
+ "<|im_start|>assistant\n")
45
+ ids = tok(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
46
+ out = model.generate(**ids, max_new_tokens=300, do_sample=False, stop_strings=["<|im_end|>"], tokenizer=tok)
47
+ print(tok.decode(out[0][ids["input_ids"].shape[1]:]).split("<|im_end|>")[0])
48
+ ```
49
+
50
+ Keep prompt plus output under 1024 tokens, the model's context length. For long sessions, feed only the most recent messages.
51
+
52
+ ## Training data
53
+
54
+ Long rows: **rows over 1024 tokens keep only the most recent whole messages that fit, always including the full supervised message (the beginning of the session is cut)**
55
+
56
+ | Dataset | License | Rows | Rejected | Duplicates | Target too long | Context cut | Examples used | In training split | Supervised | Note |
57
+ |---|---|---|---|---|---|---|---|---|---|---|
58
+ | [fable-5-coding-and-debugging-traces](https://huggingface.co/datasets/greghavens/fable-5-coding-and-debugging-traces) | CC BY 4.0 | 15961 | 0 | 0 | 1607 | 9614 | 3000 | 2933 | last_assistant | |
59
+ | [gpt-5.6-sol-coding-and-debugging-traces](https://huggingface.co/datasets/greghavens/gpt-5.6-sol-coding-and-debugging-traces) | CC BY 4.0 | 17939 | 0 | 0 | 1335 | 15607 | 3000 | 2908 | last_assistant | |
60
+ | [glm-5.2-coding-and-debugging-traces](https://huggingface.co/datasets/greghavens/glm-5.2-coding-and-debugging-traces) | other (see dataset card) | 3642 | 0 | 1825 | 129 | 1273 | 1688 | 1610 | last_assistant | |
61
+ | [kimi-k3-coding-and-debugging-traces](https://huggingface.co/datasets/greghavens/kimi-k3-coding-and-debugging-traces) | CC BY 4.0 | 3956 | 0 | 0 | 0 | 0 | 0 | 0 | last_assistant | excluded: 34% of supervised tool calls have empty arguments |
62
+
63
+ Attribution (CC BY 4.0 requires credit; check each dataset card for its license terms):
64
+
65
+ - fable-5-coding-and-debugging-traces: https://huggingface.co/datasets/greghavens/fable-5-coding-and-debugging-traces (CC BY 4.0)
66
+ - gpt-5.6-sol-coding-and-debugging-traces: https://huggingface.co/datasets/greghavens/gpt-5.6-sol-coding-and-debugging-traces (CC BY 4.0)
67
+ - glm-5.2-coding-and-debugging-traces: https://huggingface.co/datasets/greghavens/glm-5.2-coding-and-debugging-traces (other (see dataset card))
68
+
69
+ Rows are converted to ChatML (tool schemas and hidden reasoning blocks are not included). Duplicates are removed (SHA-256).
70
+ Loss is computed on assistant tokens only; the datasets use cumulative rows (each row a longer prefix of the same session), so only the
71
+ last assistant message of each row is supervised. At most 3000 examples are taken from each dataset. The split is by session, so one
72
+ session never appears in both train and validation. Split: 7451 train / 237 validation. Tokens per epoch: 4,136,424
73
+ (1,394,873 supervised). Seed 1147.
74
+
75
+ ## Training
76
+
77
+ | Setting | Value |
78
+ |---|---|
79
+ | Starting weights | WithinUsAI/WIUAI.Mini.Coder.ToolCalling |
80
+ | Hardware | 2x Tesla T4 (Kaggle), DataParallel via Hugging Face Trainer |
81
+ | Precision | fp32 master weights, fp16 mixed precision, activation checkpointing |
82
+ | Context length | 1024 |
83
+ | Batch | 4 per GPU x 2 GPUs x 4 accumulation = 32 |
84
+ | Learning rate | 2e-05 peak, cosine, 3% warmup, weight decay 0.01, grad clip 1.0 |
85
+ | Epochs | 1 (233 steps) |
86
+
87
+ ## Progress (validation loss is on assistant tokens of the held-out sessions)
88
+
89
+ Starting model before training: **3.3581**
90
+
91
+ | Step | Epoch | Train loss | Validation loss | Spot check |
92
+ |---|---|---|---|---|
93
+ | 50 | 0.21 | 2.5812 | 2.5347 | 0/2 |
94
+ | 100 | 0.43 | 2.1885 | 2.3185 | 0/2 |
95
+ | 150 | 0.64 | 2.0826 | 2.2330 | 0/2 |
96
+ | 200 | 0.86 | 2.0757 | 2.2083 | 0/2 |
97
+ | 233 | 1.00 | 1.9277 | 2.2065 | 0/2 |
98
+
99
+ ## Spot check at this checkpoint
100
+
101
+ Two fixed coding prompts. Pass = the output contains an expected snippet. A tiny smoke test, not a benchmark.
102
+
103
+ | Prompt | Pass | Stopped | Output |
104
+ |---|---|---|---|
105
+ | Write a Python function is_prime(n) that returns True if n is prime. | no | no | `<tool_call> / {"name": "exec", "arguments": {"source": "const r = await tools.exec_command({cmd:\"git status --short && git status --short &...` |
106
+ | This code raises IndexError. Fix it: | no | no | `<tool_call> / {"name": "exec", "arguments": {"source": "const r = await tools.exec_command({\"cmd\":\"pwd && git status --short\",\"pwd\":\"...` |
107
+
108
+ ## Limitations
109
+
110
+ - Context is 1024 tokens, far shorter than a typical agent session. Training rows keep only the most recent messages, so the model rarely sees the system prompt or task statement of a long session.
111
+ - Trained on traces produced by other AI models, so it can imitate their style without their reliability.
112
+ - Tool-calling behavior learned from Hermes Function-Calling V1 may have regressed. It was not re-tested after this run.
113
+ - The validation split is from the same datasets. No external benchmark was run.
114
+ - Can produce incorrect code or malformed tool calls. Review output before running it.
config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 0,
8
+ "dtype": "float32",
9
+ "eos_token_id": 0,
10
+ "head_dim": 96,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 768,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 3072,
15
+ "max_position_embeddings": 1024,
16
+ "mlp_bias": false,
17
+ "model_type": "llama",
18
+ "num_attention_heads": 8,
19
+ "num_hidden_layers": 24,
20
+ "num_key_value_heads": 8,
21
+ "pad_token_id": 0,
22
+ "pretraining_tp": 1,
23
+ "rms_norm_eps": 1e-05,
24
+ "rope_parameters": {
25
+ "rope_theta": 10000.0,
26
+ "rope_type": "default"
27
+ },
28
+ "tie_word_embeddings": false,
29
+ "transformers_version": "5.24.0",
30
+ "use_cache": true,
31
+ "vocab_size": 49152
32
+ }
generation_config.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "eos_token_id": [
5
+ 0,
6
+ 2
7
+ ],
8
+ "pad_token_id": 0,
9
+ "transformers_version": "5.24.0",
10
+ "use_cache": false
11
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:269995f2b5a862ad12e419dd06cc5baab0ea9fad7afe5b96a301d85de61f52de
3
+ size 1208134600
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<|endoftext|>",
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|endoftext|>",
7
+ "errors": "replace",
8
+ "extra_special_tokens": [
9
+ "<|endoftext|>",
10
+ "<fim_prefix>",
11
+ "<fim_middle>",
12
+ "<fim_suffix>",
13
+ "<fim_pad>",
14
+ "<filename>",
15
+ "<gh_stars>",
16
+ "<issue_start>",
17
+ "<issue_comment>",
18
+ "<issue_closed>",
19
+ "<jupyter_start>",
20
+ "<jupyter_text>",
21
+ "<jupyter_code>",
22
+ "<jupyter_output>",
23
+ "<empty_output>",
24
+ "<commit_before>",
25
+ "<commit_msg>",
26
+ "<commit_after>",
27
+ "<reponame>"
28
+ ],
29
+ "is_local": false,
30
+ "local_files_only": false,
31
+ "max_length": 1023,
32
+ "model_max_length": 1024,
33
+ "pad_token": "<|endoftext|>",
34
+ "stride": 0,
35
+ "tokenizer_class": "GPT2Tokenizer",
36
+ "truncation_side": "right",
37
+ "truncation_strategy": "longest_first",
38
+ "unk_token": "<|endoftext|>",
39
+ "vocab_size": 49152
40
+ }
train_state.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"global_step": 233, "base_model": "WithinUsAI/WIUAI.Mini.Coder.ToolCalling", "datasets": ["greghavens/fable-5-coding-and-debugging-traces", "greghavens/gpt-5.6-sol-coding-and-debugging-traces", "greghavens/glm-5.2-coding-and-debugging-traces"]}