Skip to content

Latest commit

 

History

History
81 lines (55 loc) · 1.83 KB

File metadata and controls

81 lines (55 loc) · 1.83 KB

SQL Translator - Fine-Tuning LLaMA 3 with Unsloth

Fine-tuning pipeline for SQL generation from natural language using LLaMA 3 8B. Built by Happy Hacking Space.

Overview

Setup

conda create -n sqlft python=3.10 -y
conda activate sqlft
pip install -r requirements.txt

Usage

Train:

python src/fine_tune.py                         # default config
python src/fine_tune.py --config my_config.yaml # custom config

Inference:

python src/inference.py --hf \
  --schema "employees(id, name, salary, dept_id)" \
  --question "Show employees with salary above 50000"

python src/inference.py --hf  # interactive mode

Evaluate:

python src/evaluate.py --hf
python src/evaluate.py --hf --num-samples 200
python src/evaluate.py --hf --output results.json

Configuration

All hyperparameters live in config.yaml. Key options:

dataset:
  max_samples: null       # limit dataset size (e.g. 1000)
  validation_split: 0.05  # held out for evaluation

Hardware

Setup RAM
LLaMA 3 8B (4-bit) ~12-16 GB
LLaMA 3 8B (fp16) ~32 GB

Recommended GPUs: A100, H100, 2x3090, 2x4090

Docs

Contributing

See CONTRIBUTING.md and CODE_OF_CONDUCT.md.

License

MIT License. See LICENSE.

Copyright 2025 Happy Hacking Space