Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

nits

Dan Saunderse012936d75b1
diff --git a/cli/commands/train.py b/cli/commands/train.py
index efc034d6ea8..ec9b36588d2 100644
--- a/cli/commands/train.py
+++ b/cli/commands/train.py
@@ -59,16 +59,24 @@ def train(
)
raise typer.Exit(code=2)
- from pathlib import Path as PathlibPath
+ # Check if the model path is a LoRA adapter (has adapter_config.json)
+ model_path = Path(cfg.model) if cfg.model else None
+ model_is_lora = model_path and model_path.is_dir() and (model_path / "adapter_config.json").exists()
+ use_lora = cfg.training.training_type.lower() == "lora"
+
+ if model_is_lora and not use_lora:
+ typer.echo(
+ "Error: Cannot do full finetuning on a LoRA adapter. "
+ "Use --training-type lora or provide a base model.",
+ err=True,
+ )
+ raise typer.Exit(code=2)
+
from backend.trainer import UnslothTrainer
from backend.model_config import ModelConfig
trainer = UnslothTrainer()
- # Check if the model path is a LoRA adapter (has adapter_config.json)
- model_path = PathlibPath(cfg.model) if cfg.model else None
- model_is_lora = model_path and model_path.is_dir() and (model_path / "adapter_config.json").exists()
-
model_config = ModelConfig.from_ui_selection(
dropdown_value=cfg.model, search_value=None, hf_token=hf_token, is_lora=model_is_lora
)
@@ -77,15 +85,6 @@ def train(
raise typer.Exit(code=1)
is_vision = model_config.is_vision
- use_lora = cfg.training.training_type.lower() == "lora"
-
- if model_is_lora and not use_lora:
- typer.echo(
- "Error: Cannot do full finetuning on a LoRA adapter. "
- "Use --training-type lora or provide a base model.",
- err=True,
- )
- raise typer.Exit(code=2)
if not trainer.load_model(
model_name=model_config.identifier,