Slayer1B-1.09-Instruct-26.11: weights, card, notes, training code, manifests and results (history squashed; training data not published)
6071ec5 Download training/code/check_labels.py from SlayerLab/Slayer1B-1.09-Instruct-26.11: direct link, hf CLI and curl.
- Browser
- Download file 1.49 kB
-
https://huggingface.co/SlayerLab/Slayer1B-1.09-Instruct-26.11/resolve/main/training/code/check_labels.py
- Command line
-
hf download hf://SlayerLab/Slayer1B-1.09-Instruct-26.11/training/code/check_labels.py
-
curl -L -o check_labels.py https://huggingface.co/SlayerLab/Slayer1B-1.09-Instruct-26.11/resolve/main/training/code/check_labels.py
1.49 kB
| """Decode training targets of N random rows: only assistant turns (text / tool calls) + <|im_end|> may be targets.""" | |
| import json, random, sys | |
| import numpy as np, pyarrow.parquet as pq | |
| from tokenizers import Tokenizer | |
| tok = Tokenizer.from_file(sys.argv[2]) | |
| t = pq.read_table(sys.argv[1]).to_pylist() | |
| random.Random(0).shuffle(t) | |
| bad, n_tool = 0, 0 | |
| for r in t[:50]: | |
| ids = np.frombuffer(r["input_ids"], dtype=np.uint16).tolist(); m = np.frombuffer(r["loss_mask"], dtype=np.uint8).tolist() | |
| spans, cur = [], [] | |
| for i, (x, y) in enumerate(zip(ids, m)): | |
| if y: cur.append(x) | |
| elif cur: spans.append(cur); cur = [] | |
| if cur: spans.append(cur) | |
| texts = [tok.decode(s, skip_special_tokens=False) for s in spans] | |
| full = tok.decode(ids, skip_special_tokens=False) | |
| ok = all(s.endswith("<|im_end|>") and "<|im_start|>" not in s and "<tool_response>" not in s for s in texts) | |
| # every assistant turn body must be covered: count assistant headers vs target spans (context-only turns allowed fewer) | |
| n_asst = full.count("<|im_start|>assistant\n") | |
| ok = ok and 1 <= len(spans) <= n_asst | |
| bad += not ok; n_tool += r["is_tool"] | |
| if not ok or r is t[0] or (r["is_tool"] and n_tool == 1): | |
| print("----", r["id"], "tool" if r["is_tool"] else "chat", "ok" if ok else "BAD", f"asst_turns={n_asst} target_spans={len(spans)}") | |
| for s in texts[:3]: print(" TARGET:", repr(s[:220])) | |
| print(json.dumps({"checked": 50, "bad": bad, "tool_rows": n_tool})) | |