LLaMA Factory: WebUI and CLI fine-tuning guide
Learn LLaMA Factory setup, dataset registration and fine-tuning through WebUI and YAML-based CLI training, with a 4-bit LoRA example in Google Colab.
Player not loading? Watch on YouTube
Sunny explains how to fine-tune models with LLaMA Factory, an open source project with a browser interface and command-line workflow. He reviews training methods and model families before demonstrating supervised fine-tuning. The dataset discussion covers Alpaca instruction/input/output records, ShareGPT conversations and preference data with prompt, chosen and rejected fields.
The practical setup runs in Google Colab. Sunny says users can also run the project on their own hardware with a suitable system; LLaMA Factory itself supplies neither a server nor a GPU. He clones the repository, installs dependencies and fixes an installation error caused by the working directory resetting after a runtime restart. The demonstration uses Hugging Face authentication and a public Gradio URL to reach the interface from Colab.
For training, he selects a small Gemma instruct model, LoRA with 4-bit bitsandbytes quantization, and one epoch. He explains how to register local JSON files or Hugging Face datasets in dataset_info.json. After reporting that the WebUI run finished in roughly four to five minutes, he loads the model and asks about a Unix command.
The CLI section moves training settings into a YAML file and outlines inference with model and adapter paths. That run remains in progress at the end; Sunny warns that growing RAM use could cause a crash.