Skip to content

Commit 40c6899

Browse files
authored
Merge pull request #12 from bahree/meap-chap-1-5
MEAP review feedback - Ch6-9
2 parents 535b753 + 28eb351 commit 40c6899

5 files changed

Lines changed: 292 additions & 2 deletions

File tree

‎.gitignore‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ cover/
5050

5151
# Environments
5252
.env
53+
.env.*
54+
!.env.example
55+
!code/.env.example
5356
.envrc
5457
.venv
5558
env/
@@ -79,4 +82,20 @@ cython_debug/
7982
code/**/runs/
8083
code/**/wandb/
8184
code/**/__pycache__/
82-
code/**/.pytest_cache/
85+
code/**/.pytest_cache/
86+
87+
# SSH keys / credentials (never commit private keys or secrets)
88+
*.pem
89+
*.key
90+
id_rsa*
91+
id_ed25519*
92+
id_ecdsa*
93+
*_rsa
94+
*_ed25519
95+
*_ecdsa
96+
*_key
97+
*_key.txt
98+
known_hosts
99+
*.ppk
100+
secrets.*
101+
credentials.*

‎CHANGELOG.md‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
88

99
<!-- Changes landing on `main` between releases go here. -->
1010

11+
### Added
12+
13+
- **Chapters 6 through 9** (2026-09-23) — the remaining hands-on code: full supervised fine-tuning (`chapter06`), black-box distillation (`chapter07`), DPO with GRPO/RFT examples (`chapter08`), and the operations toolkit (`chapter09`: JSON model registry, TF-IDF drift detector, rollback demo, safety monitor). All run on the shared IT-support dataset in `data/it_support/` with the held-out test split (`--split test`).
14+
15+
### Changed
16+
17+
- **Chapter 6** (2026-09-26) — `eval/safety/` now holds the run the chapter prints (base 62%, fine-tuned 62%, harmful-request refusal 100% to 50%, regression flagged); the README's safety summary matches it.
18+
- **Chapter 8** (2026-09-26) — README training-time row reflects the measured runs (about 3.5 min full DPO on three 24 GB cards, about 2.8 min LoRA-DPO on one).
19+
- **Chapter 9** (2026-09-26) — README safety-monitor compare command writes `safety_report_dpo.json` against `safety_report.json`; `model_registry.py` docstring shows `--registry_dir` before the subcommand; the retired `data/drift_report_same_domain.json` removed.
20+
1121
## [MEAP-v0.1] — TBD
1222

1323
First public release of the code repository alongside Manning's MEAP launch.
@@ -27,7 +37,7 @@ First public release of the code repository alongside Manning's MEAP launch.
2737

2838
### Notes
2939

30-
- Chapters 6 through 9 (Full SFT, Distillation, DPO, Operations) are written and will be released to this repo as they reach MEAP in subsequent drops.
40+
- Chapters 6 through 9 (Full SFT, Distillation, DPO, Operations) landed on `main` on 2026-09-23 (see Unreleased above).
3141
- All hands-on chapters use Qwen3-4B-Instruct-2507 as the base model and Databricks Dolly-15K (filtered subsets) as the dataset, so the chapters compose into a single coherent example pipeline.
3242

3343
---

‎code/chapter05/eval/test_split/eval_report_test.log‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
Step 1/4: Loading base model...
3+
Failed to load /home/amit/FTBook-pvt/code/.venv/lib/python3.12/site-packages/torchao/_C_mxfp8.cpython-310-x86_64-linux-gnu.so: Could not load this library: /home/amit/FTBook-pvt/code/.venv/lib/python3.12/site-packages/torchao/_C_mxfp8.cpython-310-x86_64-linux-gnu.so
4+
Failed to load /home/amit/FTBook-pvt/code/.venv/lib/python3.12/site-packages/torchao/_C_cutlass_90a.abi3.so: Could not load this library: /home/amit/FTBook-pvt/code/.venv/lib/python3.12/site-packages/torchao/_C_cutlass_90a.abi3.so
5+
/home/amit/FTBook-pvt/code/.venv/lib/python3.12/site-packages/torch/cuda/__init__.py:1061: UserWarning: Can't initialize NVML
6+
raw_cnt = _raw_device_count_nvml()
7+
Loading checkpoint shards: 0%| | 0/3 [00:00<?, ?it/s]Loading checkpoint shards: 33%|███▎ | 1/3 [00:01<00:02, 1.17s/it]Loading checkpoint shards: 67%|██████▋ | 2/3 [00:02<00:01, 1.14s/it]Loading checkpoint shards: 100%|██████████| 3/3 [00:02<00:00, 1.29it/s]
8+
✓ Base model loaded
9+
10+
Step 2/4: Evaluating base model...
11+
The following generation flags are not valid and may be ignored: ['temperature', 'top_p', 'top_k']. Set `TRANSFORMERS_VERBOSITY=info` for more details.
12+
Evaluating examples... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
13+
Evaluating toy test set... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
14+
Running safety checks... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
15+
✓ Base evaluation complete
16+
17+
Step 3/4: Loading adapter from chapter05/runs/it_lora...
18+
Loading checkpoint shards: 0%| | 0/3 [00:00<?, ?it/s]Loading checkpoint shards: 33%|███▎ | 1/3 [00:00<00:01, 1.64it/s]Loading checkpoint shards: 67%|██████▋ | 2/3 [00:01<00:00, 1.60it/s]Loading checkpoint shards: 100%|██████████| 3/3 [00:01<00:00, 2.37it/s]
19+
✓ Adapter loaded
20+
21+
Step 4/4: Evaluating fine-tuned model...
22+
Evaluating examples... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
23+
Evaluating toy test set... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
24+
Running safety checks... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
25+
✓ Fine-tuned evaluation complete
26+
27+
28+
Writing evaluation reports...
29+
30+
✓ Evaluation complete!
31+
✓ JSON report: chapter05/runs/eval_report/report.json
32+
✓ Markdown summary: chapter05/runs/eval_report/report.md
33+
34+
→ View the markdown report for a human-readable summary

0 commit comments

Comments
 (0)