Fine-tuning

Fine-tuning Script Generator

Fill in the dataset path, model, epochs, batch size and learning rate and get a complete script: Ultralytics YOLO with data.yaml and train and val commands, a Hugging Face Transformers + PEFT LoRA script for chat SFT with TRL, or a torchvision/timm image-classification script. Each includes a requirements list, evaluation and export steps, and comments where a choice matters.

Loading the tool…

How it works

01

Pick the recipe

YOLO detection or segmentation, LLM LoRA / QLoRA SFT, image classification. Each shows only the fields it needs.

02

Fill in your numbers

Paths, model name, epochs, batch, learning rate, image size or sequence length, LoRA rank. Sensible defaults are pre-filled and explained.

03

Copy or download

train.py, the config file and requirements.txt as a zip, plus the shell commands to run them.

Formats, limits and the numbers that matter

YOLO defaults

yolo11n/s/m, imgsz 640, 100 epochs, batch 16, patience 20, then val and export to ONNX with the same imgsz.

LoRA defaults

rank 16, alpha 32, dropout 0.05 on q/k/v/o (and MLP projections optionally), lr 2e-4, cosine schedule with 3 percent warmup, 3 epochs, bf16, gradient checkpointing, packing off.

Classifier defaults

timm convnext_tiny or resnet50 pretrained, AdamW 3e-4, cosine, label smoothing 0.1, 20 epochs, ImageFolder layout from the labeler or splitter.

Common questions

Will it run as-is?

Yes on a machine with the listed requirements and the paths you gave; the script prints the resolved config at start so mismatches show immediately.

How do I choose the learning rate?

Start with the default, watch the loss for the first hundred steps: divergence means too high, no movement means too low. LoRA tolerates higher rates than full fine-tuning.

Can it target PaddleOCR?

A PaddleOCR detection and recognition config generator is next on the list.