Skip to content
jtrefonPublic

About

small and simple but effective way to finetune reasoning model

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

LORA

LORA is a practical LoRA fine-tuning framework for Hugging Face transformer models.

This repository focuses on a clean training workflow (via scripts/train.py + YAML configs), plus an interactive inference tool (scripts/chat.py) for testing trained adapters.

Author: Jacek Trefon

What you can do with this repo

  • Train LoRA adapters on your own data (including chat-style messages datasets)
  • Track key training metrics (loss, eval loss, perplexity)
  • Load a base model + LoRA adapter and chat interactively, with optional streaming output

Quick start

1) Install

Python 3.8+ is required. Python 3.10+ is recommended.

pip install -r requirements.txt
pip install -e .

2) Train a LoRA adapter

The fastest way to validate end-to-end training (especially on Apple Silicon) is to use the provided config:

python scripts/train.py --config configs/m4_mps_quick.yaml

Training outputs are written to training.output_dir (for example ./outputs/m4_quick).

3) Chat with the trained adapter

python scripts/chat.py \
  --base_model Qwen/Qwen3-1.7B \
  --adapter_dir outputs/m4_quick/final_model \
  --device mps \
  --cache_dir ./.cache/hf \
  --stream \
  --show_stop_reason \
  --max_new_tokens 2048

Helpful chat commands:

  • /reset
  • /sample (requires --dataset_jsonl)
  • /exit

Dataset format

This repo supports instruction/chat fine-tuning using a JSONL dataset where each record contains messages.

Example record:

{"id":"example-001","messages":[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":"Hello"},{"role":"assistant","content":"Hi!"}]}

See:

  • datasets/instruction_samples/software_dev_messages.jsonl
  • docs/DATASETS.md

Configuration

Configs live in configs/.

  • configs/m4_mps_quick.yaml is a minimal validation config
  • configs/rtx4090_cuda_*.yaml are examples for CUDA training

See docs/TRAINING.md.

Documentation

  • docs/GETTING_STARTED.md
  • docs/DATASETS.md
  • docs/TRAINING.md
  • docs/INFERENCE.md

Contributing

See CONTRIBUTING.md.

License

Licensed under Apache-2.0. See LICENSE.

Citation

If you use this project, please cite it using CITATION.cff.

About

small and simple but effective way to finetune reasoning model

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages