Loads YAML config file.
Loads the base model and applies LoRA. All parameters come from config.yaml.
Loads the dataset, applies train/validation split, and formats prompts in Alpaca style.
Runs SFT training and saves the model to the configured output directory.
Loads a fine-tuned model for inference.
Generates SQL from natural language. Returns {"sql": ..., "explanation": ...}.
Splits raw model output into SQL and explanation parts.
Loads the saved validation set, or creates a split if not available.
Runs exact match evaluation and prints progress.
python src/fine_tune.py --config config.yaml
python src/inference.py --hf --schema "..." --question "..."
python src/evaluate.py --hf --num-samples 100 --output results.json