betterwithage's picture
atelier: one-of-one card — cut, silhouette, GitHub Python. YAML preserved.
99e43cf verified
|
Raw
History Blame Contribute Delete
3.71 kB
metadata
license: apache-2.0
library_name: other
tags:
  - governed-ai
  - szl-holdings
  - doctrine-v11
  - estate
  - hub

szl-training-scripts

The forge. Hub copy of the Unsloth-receipted training scripts. Tags were empty — this atelier is the card.

Family. estate · Evidence. HUB · Weights. none

Hub: SZLHOLDINGS/szl-training-scripts

The cut

Training code is usually a gist. We give it a model id so the estate graph stays one piece.

A Hub id you can pin in a receipt: 'trained by this repo at this SHA'.

Silhouette → leave → SZL

Leader Take, then tweak
Anthropic No public train scripts for Claude.
NVIDIA NeMo recipes.
Unsloth The scripts wrap Unsloth. Cut is the receipt bind.

Nobody else ships this combination. That is the point of a one-of-one.

Intended use

Canonical train entrypoint.

Limitations

  • Not a checkpoint. Wire to GitHub kit in this atelier.

Honesty

Claim Label
This card's numbers HUB
Energy / joules UNAVAILABLE unless a signed meter says MEASURED
Λ uniqueness Conjecture 1 OPEN — not a theorem
GGUF as the signed object FALSE

Doctrine v11 LOCKED · 749 declarations · 14 axioms · 163 sorries · locked-proven 8.

Apache-2.0. Copyright 2026 SZL Holdings · Stephen P. Lutar Jr. · ORCID 0009-0001-0110-4173.

GitHub-aligned Python

#!/usr/bin/env python3
# receipted_unsloth.py
# Silhouette: Unsloth FastLanguageModel QLoRA.
# Cut: dataset SHA, LoRA knobs, seed, and final loss go into a training receipt
# BEFORE merge. GGUF is derived — never the signed object.

from __future__ import annotations

import argparse
import hashlib
import json
import time
from pathlib import Path


def sha256_file(p: Path) -> str:
    h = hashlib.sha256()
    with p.open("rb") as f:
        for chunk in iter(lambda: f.read(1 << 20), b""):
            h.update(chunk)
    return h.hexdigest()


def main() -> None:
    ap = argparse.ArgumentParser()
    ap.add_argument("--base", default="Qwen/Qwen2.5-1.5B-Instruct")
    ap.add_argument("--data", default="doctrine.jsonl")
    ap.add_argument("--out", default="out/adapter")
    ap.add_argument("--r", type=int, default=16)
    ap.add_argument("--seed", type=int, default=20260721)
    ap.add_argument("--max-seq", type=int, default=2048)
    args = ap.parse_args()

    data_sha = sha256_file(Path(args.data))
    from unsloth import FastLanguageModel
    from datasets import load_dataset
    from trl import SFTConfig, SFTTrainer

    model, tokenizer = FastLanguageModel.from_pretrained(
        model_name=args.base,
        max_seq_length=args.max_seq,
        load_in_4bit=True,
    )
    model = FastLanguageModel.get_peft_model(
        model,
        r=args.r,
        lora_alpha=args.r,
        target_modules=["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"],
        lora_dropout=0,
        bias="none",
        use_gradient_checkpointing="unsloth",
        random_state=args.seed,
    )
    ds = load_dataset("json", data_files=args.data, split="train")
    trainer = SFTTrainer(
        model=model,
        tokenizer=tokenizer,
        train_dataset=ds,
        args=SFTConfig(
            output_dir=args.out,
            per_device_train_batch_size=2,
            gradient_accumulation_steps=4,
            max_steps=120,
            learning_rate=2e-4,
            logging_steps=10,
            seed=args.seed,
        ),
    )
    t0 = time.time()
    trainer.train()
    model.save_pretrained(args.out)
    loss = None
    if trainer.state.log_hi