CLI fix for backend changes

This commit is contained in:
Manan17 2026-03-09 07:00:06 +00:00
commit 8c493bbd20
2 changed files with 11 additions and 6 deletions

View file

@ -25,8 +25,11 @@ def list_checkpoints(
typer.echo("No checkpoints found.")
raise typer.Exit()
for display, path in checkpoints:
typer.echo(f"{display}: {path}")
for model_name, ckpt_list, metadata in checkpoints:
typer.echo(f"\n{model_name}:")
for display, path, loss in ckpt_list:
loss_str = f" (loss: {loss:.4f})" if loss is not None else ""
typer.echo(f" {display}{loss_str}: {path}")
def export(

View file

@ -81,7 +81,7 @@ def train(
)
raise typer.Exit(code=2)
from studio.backend.core.training import UnslothTrainer
from studio.backend.core.training.trainer import UnslothTrainer
trainer = UnslothTrainer()
@ -101,18 +101,20 @@ def train(
typer.echo("Model preparation failed", err=True)
raise typer.Exit(code=1)
ds = trainer.load_and_format_dataset(
result = trainer.load_and_format_dataset(
dataset_source=cfg.data.dataset or "",
format_type=cfg.data.format_type,
local_datasets=cfg.data.local_dataset,
)
if ds is None:
if result is None:
typer.echo("Dataset load failed", err=True)
raise typer.Exit(code=1)
ds, eval_ds = result
training_kwargs = cfg.training_kwargs()
training_kwargs["wandb_token"] = wandb_token # CLI/env takes precedence
started = trainer.start_training(dataset=ds, **training_kwargs)
started = trainer.start_training(dataset=ds, eval_dataset=eval_ds, **training_kwargs)
if not started:
typer.echo("Training failed to start", err=True)