betterwithage commited on
Commit
99e43cf
·
verified ·
1 Parent(s): d0fe8e4

atelier: one-of-one card — cut, silhouette, GitHub Python. YAML preserved.

Browse files
Files changed (1) hide show
  1. README.md +133 -0
README.md ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: other
4
+ tags:
5
+ - governed-ai
6
+ - szl-holdings
7
+ - doctrine-v11
8
+ - estate
9
+ - hub
10
+ ---
11
+
12
+ # szl-training-scripts
13
+
14
+ The forge. Hub copy of the Unsloth-receipted training scripts. Tags were empty — this atelier is the card.
15
+
16
+ **Family.** estate · **Evidence.** HUB · **Weights.** none
17
+
18
+ Hub: [SZLHOLDINGS/szl-training-scripts](https://huggingface.co/SZLHOLDINGS/szl-training-scripts)
19
+
20
+ ## The cut
21
+
22
+ Training code is usually a gist. We give it a model id so the estate graph stays one piece.
23
+
24
+ A Hub id you can pin in a receipt: 'trained by this repo at this SHA'.
25
+
26
+ ### Silhouette → leave → SZL
27
+
28
+ | Leader | Take, then tweak |
29
+ |---|---|
30
+ | Anthropic | No public train scripts for Claude. |
31
+ | NVIDIA | NeMo recipes. |
32
+ | Unsloth | The scripts wrap Unsloth. Cut is the receipt bind. |
33
+
34
+ Nobody else ships this combination. That is the point of a one-of-one.
35
+
36
+ ## Intended use
37
+
38
+ Canonical train entrypoint.
39
+
40
+ ## Limitations
41
+
42
+ - Not a checkpoint. Wire to GitHub kit in this atelier.
43
+
44
+ ## Honesty
45
+
46
+ | Claim | Label |
47
+ |---|---|
48
+ | This card's numbers | HUB |
49
+ | Energy / joules | UNAVAILABLE unless a signed meter says MEASURED |
50
+ | Λ uniqueness | Conjecture 1 OPEN — not a theorem |
51
+ | GGUF as the signed object | FALSE |
52
+
53
+ Doctrine v11 LOCKED · 749 declarations · 14 axioms · 163 sorries · locked-proven 8.
54
+
55
+ Apache-2.0. Copyright 2026 SZL Holdings · Stephen P. Lutar Jr. · ORCID [0009-0001-0110-4173](https://orcid.org/0009-0001-0110-4173).
56
+
57
+ ## GitHub-aligned Python
58
+
59
+ ```python
60
+ #!/usr/bin/env python3
61
+ # receipted_unsloth.py
62
+ # Silhouette: Unsloth FastLanguageModel QLoRA.
63
+ # Cut: dataset SHA, LoRA knobs, seed, and final loss go into a training receipt
64
+ # BEFORE merge. GGUF is derived — never the signed object.
65
+
66
+ from __future__ import annotations
67
+
68
+ import argparse
69
+ import hashlib
70
+ import json
71
+ import time
72
+ from pathlib import Path
73
+
74
+
75
+ def sha256_file(p: Path) -> str:
76
+ h = hashlib.sha256()
77
+ with p.open("rb") as f:
78
+ for chunk in iter(lambda: f.read(1 << 20), b""):
79
+ h.update(chunk)
80
+ return h.hexdigest()
81
+
82
+
83
+ def main() -> None:
84
+ ap = argparse.ArgumentParser()
85
+ ap.add_argument("--base", default="Qwen/Qwen2.5-1.5B-Instruct")
86
+ ap.add_argument("--data", default="doctrine.jsonl")
87
+ ap.add_argument("--out", default="out/adapter")
88
+ ap.add_argument("--r", type=int, default=16)
89
+ ap.add_argument("--seed", type=int, default=20260721)
90
+ ap.add_argument("--max-seq", type=int, default=2048)
91
+ args = ap.parse_args()
92
+
93
+ data_sha = sha256_file(Path(args.data))
94
+ from unsloth import FastLanguageModel
95
+ from datasets import load_dataset
96
+ from trl import SFTConfig, SFTTrainer
97
+
98
+ model, tokenizer = FastLanguageModel.from_pretrained(
99
+ model_name=args.base,
100
+ max_seq_length=args.max_seq,
101
+ load_in_4bit=True,
102
+ )
103
+ model = FastLanguageModel.get_peft_model(
104
+ model,
105
+ r=args.r,
106
+ lora_alpha=args.r,
107
+ target_modules=["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"],
108
+ lora_dropout=0,
109
+ bias="none",
110
+ use_gradient_checkpointing="unsloth",
111
+ random_state=args.seed,
112
+ )
113
+ ds = load_dataset("json", data_files=args.data, split="train")
114
+ trainer = SFTTrainer(
115
+ model=model,
116
+ tokenizer=tokenizer,
117
+ train_dataset=ds,
118
+ args=SFTConfig(
119
+ output_dir=args.out,
120
+ per_device_train_batch_size=2,
121
+ gradient_accumulation_steps=4,
122
+ max_steps=120,
123
+ learning_rate=2e-4,
124
+ logging_steps=10,
125
+ seed=args.seed,
126
+ ),
127
+ )
128
+ t0 = time.time()
129
+ trainer.train()
130
+ model.save_pretrained(args.out)
131
+ loss = None
132
+ if trainer.state.log_hi
133
+ ```