--- license: apache-2.0 language: - en tags: - sakthai - house-of-sak - notebooks - fine-tuning - kaggle datasets: - Nanthasit/sakthai-combined-v6 - Nanthasit/sakthai-combined-v7 - Nanthasit/sakthai-bench-v1 --- # SakThai Kaggle Notebooks & Deploy Scripts
[![Dataset on HF](https://huggingface.co/datasets/Nanthasit/sakthai-kaggle-notebooks/badge.svg)](https://huggingface.co/datasets/Nanthasit/sakthai-kaggle-notebooks) [![Downloads](https://img.shields.io/badge/dynamic/json?url=https://huggingface.co/api/datasets/Nanthasit/sakthai-kaggle-notebooks&query=$.downloads&label=downloads&color=blue)](https://huggingface.co/datasets/Nanthasit/sakthai-kaggle-notebooks) ![Last updated](https://img.shields.io/badge/updated-2026--07--30-green) ![License](https://img.shields.io/badge/license-Apache%202.0-brightgreen) [![Collection](https://img.shields.io/badge/๐Ÿ -SakThai%20Family-6644cc)](https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02)
> The exact training notebooks, job scripts, and deploy scripts used to build the **SakThai** family โ€” > LoRA fine-tune โ†’ GGUF conversion โ†’ HF publish, all on free Kaggle GPUs. > Part of the [House of Sak](https://huggingface.co/Nanthasit). --- ## Dataset Info | Attribute | Value | |-----------|-------| | Files | **16** (14 content files + `README.md` + `.gitattributes`) | | Total size | **~141 KB** | | Created | 2026-07-06 | | Last updated | 2026-07-30 | | Downloads | **184** | | License | Apache 2.0 | | Repository type | Dataset (notebook & script collection) | | Format | `.py` (PEP 723 inline-script), `.ipynb` (Jupyter notebook) | --- ## Data Fields This dataset is a **collection of Python scripts and Jupyter notebooks**, not a tabular dataset. Each file is a self-contained artifact with the following attributes: | Field | Type | Description | |-------|------|-------------| | `filename` | `string` | File name (e.g., `job-0.5b-v7.py`) | | `path` | `string` | Full path within the repo (e.g., `scripts/train-sakthai-1.5b-v2.py`) | | `size` | `integer` | File size in KB | | `type` | `string` | Category: `training-notebook`, `training-script`, `eval-script`, `validation-script`, `deployment-script`, `infra` | | `model_target` | `string` | Target model size: `0.5B`, `1.5B`, `7B`, or `all` | | `purpose` | `string` | One-sentence description of the file's role in the pipeline | | `era` | `string` | Pipeline generation: `v6-era`, `v7-era`, or `infra` | | `dependencies` | `string` | Key Python package dependencies (e.g., `transformers`, `trl`, `peft`, `huggingface_hub`) | ### Category Breakdown | Category | Count | Files | |----------|-------|-------| | Training notebooks | 2 | `sakthai-engine.ipynb`, `sakthai-7b-engine.ipynb` | | 0.5B job scripts | 6 | `train-sakthai-0.5b-v2.py`, `job-0.5b-v7.py`, `job-0.5b-hfjobs.py`, `job-0.5b-exp.py`, `job-0.5b-nanguard.py`, `job-0.5b-nanhunt.py` | | 1.5B / 7B scripts | 2 | `scripts/train-sakthai-1.5b-v2.py`, `scripts/sakthai-7b-post-train.py` | | Evaluation & validation | 3 | `eval-bfcl-0.5b.py`, `validate.py`, `validate_exp.py` | | Deployment | 1 | `deploy-endpoint.py` | | Infrastructure | 2 | `README.md`, `.gitattributes` | ### File Details #### Training Notebooks | File | Size | Model | Era | Dependencies | |------|------|-------|-----|-------------| | `sakthai-engine.ipynb` | 10.5 KB | 1.5B (Qwen2.5-1.5B-Instruct) | v6 | `transformers`, `trl`, `peft`, `bitsandbytes`, `accelerate`, `huggingface_hub`, `wandb` | | `sakthai-7b-engine.ipynb` | 24.0 KB | 7B (Qwen2.5-7B-Instruct) | v6 | `transformers`, `trl`, `peft`, `bitsandbytes`, `accelerate`, `huggingface_hub`, `wandb` | #### Job Scripts (0.5B) | File | Size | Model | Era | Dependencies | |------|------|-------|-----|-------------| | `train-sakthai-0.5b-v2.py` | 6.8 KB | 0.5B (Qwen2.5-0.5B-Instruct) | v6 | `transformers`, `trl`, `peft`, `datasets`, `huggingface_hub` | | `job-0.5b-v7.py` | 10.2 KB | 0.5B | v7 | `transformers`, `trl`, `peft`, `datasets`, `huggingface_hub` | | `job-0.5b-hfjobs.py` | 7.8 KB | 0.5B | v7 | `transformers`, `trl`, `peft`, `datasets` | | `job-0.5b-exp.py` | 12.9 KB | 0.5B | v7 | `transformers`, `trl`, `peft`, `datasets`, `wandb` | | `job-0.5b-nanguard.py` | 13.2 KB | 0.5B | v7 | `transformers`, `trl`, `peft`, `datasets` | | `job-0.5b-nanhunt.py` | 11.8 KB | 0.5B | v7 | `transformers`, `trl`, `peft`, `datasets` | #### Training Scripts (1.5B, 7B) | File | Size | Model | Era | Dependencies | |------|------|-------|-----|-------------| | `scripts/train-sakthai-1.5b-v2.py` | 4.5 KB | 1.5B | v6 | `transformers`, `trl`, `peft`, `datasets` | | `scripts/sakthai-7b-post-train.py` | 13.7 KB | 7B | v6 | `transformers`, `peft`, `huggingface_hub`, `llama-cpp-python` | #### Evaluation & Validation | File | Size | Model | Era | Dependencies | |------|------|-------|-----|-------------| | `eval-bfcl-0.5b.py` | 3.9 KB | 0.5B | v7 | `datasets`, `transformers`, `torch` | | `validate.py` | 4.9 KB | 0.5B | v7 | `datasets`, `transformers` | | `validate_exp.py` | 3.7 KB | 0.5B | v7 | `datasets`, `transformers` | #### Deployment & Infra | File | Size | Purpose | Dependencies | |------|------|---------|-------------| | `deploy-endpoint.py` | 3.1 KB | Deploy to HF Inference Endpoints | `huggingface_hub` | | `.gitattributes` | 2.4 KB | Git LFS config | โ€” | | `README.md` | ~7 KB | Dataset card (this file) | โ€” | --- ## How These Notebooks Were Collected & Filtered **Origin.** These notebooks were written from scratch by the SakThai project as part of the iterative model development pipeline. They are not scraped or collected from external sources โ€” each script was authored to solve a specific training, evaluation, or deployment need. **Evolution.** The collection grew organically across multiple training cycles: 1. **v6 era** (July 2026) โ€” Initial notebooks trained the 1.5B and 7B models on `sakthai-combined-v6` via Kaggle's free T4 GPU. These produced the first merged models and established the LoRA โ†’ GGUF pipeline. 2. **v7 era** (late July 2026) โ€” A new generation of job scripts was written to fine-tune the 0.5B variant on `sakthai-combined-v7`. These scripts incorporated lessons from earlier failures: - **No mid-run Hub pushes** (`save_strategy="no"`) โ€” a checkpoint push failure had killed a 2-hour run - **No Trackio logging** (`report_to="none"`) โ€” Trackio's config-to-parquet export couldn't serialise PEFT's empty `rank_pattern` struct - **Bench-exclusion filtering** โ€” every row reserved by `sakthai-bench-v1` is excluded from training - **Prompt masking** โ€” loss computed only on completion tokens, not the system prompt 3. **Validation scripts** โ€” Two `validate*.py` scripts were added to prove every non-GPU component locally before launching paid jobs, catching data pipeline bugs early. 4. **Experimental scripts** โ€” `job-0.5b-exp.py`, `job-0.5b-nanguard.py`, and `job-0.5b-nanhunt.py` capture specific run configurations for reproducibility of ablation studies on prompt masking and LoRA strategies. **Filtering criteria.** Scripts were included if they: - Directly contribute to training, evaluating, validating, or deploying a SakThai model - Are self-contained (PEP 723 inline script metadata for dependencies where applicable) - Are licensed Apache 2.0 - Are functionally distinct (duplicate-mode scripts like `nanguard`/`nanhunt` are included because they capture specific run configurations for reproducibility) --- ## Usage ### Load with the ๐Ÿค— Datasets library ```python from datasets import load_dataset # Load the dataset (returns a Dataset with file metadata) ds = load_dataset("Nanthasit/sakthai-kaggle-notebooks", split="train") print(ds) # Dataset({ # features: ['filename', 'path', 'size', 'type', 'model_target', 'purpose', 'era', 'dependencies'], # num_rows: 16 # }) # List all filenames in the collection for row in ds: print(f"{row['filename']:40s} {row['type']:20s} {row['model_target']:6s} {row['era']}") ``` ### List all available files via HfApi ```python from huggingface_hub import HfApi api = HfApi() files = api.list_repo_files("Nanthasit/sakthai-kaggle-notebooks", repo_type="dataset") for f in sorted(files): print(f) ``` ### Download a specific script ```python from huggingface_hub import hf_hub_download # Download a specific training script script_path = hf_hub_download( repo_id="Nanthasit/sakthai-kaggle-notebooks", repo_type="dataset", filename="job-0.5b-v7.py" ) print(f"Downloaded to: {script_path}") ``` ### Run a training job (PEP 723 inline-script) ```bash # All job scripts are PEP 723 inline-script compatible cd /tmp curl -OL https://huggingface.co/datasets/Nanthasit/sakthai-kaggle-notebooks/raw/main/job-0.5b-v7.py uv run job-0.5b-v7.py ``` ### Open notebooks in Kaggle ```bash curl -OL https://huggingface.co/datasets/Nanthasit/sakthai-kaggle-notebooks/raw/main/sakthai-engine.ipynb # Then upload to Kaggle via kaggle kernels push ``` --- ## File Inventory | # | File | Type | Size | |---|------|------|------| | 1 | `sakthai-engine.ipynb` | Training notebook (1.5B) | 10.5 KB | | 2 | `sakthai-7b-engine.ipynb` | Training notebook (7B) | 24.0 KB | | 3 | `train-sakthai-0.5b-v2.py` | Training script (0.5B, v6) | 6.8 KB | | 4 | `job-0.5b-v7.py` | Training script (0.5B, v7) | 10.2 KB | | 5 | `job-0.5b-hfjobs.py` | Training script (0.5B, HF Jobs) | 7.8 KB | | 6 | `job-0.5b-exp.py` | Experimental script (0.5B) | 12.9 KB | | 7 | `job-0.5b-nanguard.py` | Ablation: nan guard | 13.2 KB | | 8 | `job-0.5b-nanhunt.py` | Ablation: nan hunt | 11.8 KB | | 9 | `scripts/train-sakthai-1.5b-v2.py` | Training script (1.5B) | 4.5 KB | | 10 | `scripts/sakthai-7b-post-train.py` | Post-training (7B) | 13.7 KB | | 11 | `eval-bfcl-0.5b.py` | BFCL evaluation | 3.9 KB | | 12 | `validate.py` | Validation script | 4.9 KB | | 13 | `validate_exp.py` | Experimental validation | 3.7 KB | | 14 | `deploy-endpoint.py` | Deploy to HF Endpoints | 3.1 KB | | 15 | `.gitattributes` | Git LFS config | 2.4 KB | | 16 | `README.md` | This dataset card | ~7 KB | --- ## Related Datasets & Models | Asset | Description | |-------|-------------| | [Nanthasit/sakthai-combined-v6](https://huggingface.co/datasets/Nanthasit/sakthai-combined-v6) | Base training data (v6 generation) | | [Nanthasit/sakthai-combined-v7](https://huggingface.co/datasets/Nanthasit/sakthai-combined-v7) | Extended training data (v7 generation) | | [Nanthasit/sakthai-bench-v1](https://huggingface.co/datasets/Nanthasit/sakthai-bench-v1) | Benchmark holdout data | | [Nanthasit/sakthai-tool-calling-v1](https://huggingface.co/datasets/Nanthasit/sakthai-tool-calling-v1) | Tool-calling training data (SimpleToolCalling) | | ๐Ÿค– [SakThai Agents](https://huggingface.co/Nanthasit) | All models in the House of Sak | | ๐Ÿ  [SakThai Model Family](https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02) | Complete model family collection | ---
Built with โค๏ธ by Beer ยท Part of the House of Sak โ€” one family, one home.