- 1Launch an H100 with the Fine-tune starter. Llama is already cached.
- 2Upload your dataset (JSONL with prompt/response) to /data.
- 3Run the script below. Checkpoints save every 10%.
- 4Download the adapter from /out, or keep it for inference. Deploy this template
from unsloth import FastLanguageModel
from trl import SFTTrainer
from datasets import load_dataset
model, tok = FastLanguageModel.from_pretrained(
"/cache/llama-3.1-8b", load_in_4bit=True) # pre-warmed, no download
model = FastLanguageModel.get_peft_model(model, r=16)
ds = load_dataset("json", data_files="/data/train.jsonl")["train"]
SFTTrainer(model=model, tokenizer=tok, train_dataset=ds,
args=dict(output_dir="/out", save_steps=0.1,
num_train_epochs=1)).train()