Commit Graph

2 Commits

Author SHA1 Message Date
Alpamys a63e8875f0 refactor(tests): polish DPO example tests from PR #48
- Split the 22-assert config-values test into 3 focused tests
  (task+data, training hyperparams, LoRA config) so a deliberate
  example change surfaces in one targeted test, not a wall of asserts
- Add module docstring explaining why these tests lock the example state
- Add `from __future__ import annotations` (defensive; matches 14 other
  test modules in the project)
- Rename `f` -> `fh` in _load_jsonl to avoid shadowing short name
- Drop asserts on secondary fields (warmup_ratio, weight_decay, scheduler,
  logging_steps, etc.) -- they're tweakable knobs, not the example's
  teaching points; test brittleness > coverage here
2026-04-23 12:22:52 +05:00
Chinmaya Sahu 0e69b210e3
feat(examples): add DPO example config, sample data, and tests (#48)
Add a working DPO (Direct Preference Optimization) example using the
current Pydantic config schema with Llama 3.1 8B Instruct and QLoRA.

- examples/configs/dpo_example.yaml: DPO config with all core training
  and LoRA parameters, plus commented-out advanced options
- examples/data/dpo_sample.jsonl: 8 preference pairs in DPO format
  with ShareGPT-style message lists for chosen/rejected
- tests/test_dpo_example.py: 7 tests validating config loading, field
  values, data format detection, and data validation
- examples/README.md: document the new DPO with QLoRA example
2026-04-23 12:20:06 +05:00