Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/tether/finetune/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""
from __future__ import annotations

import json
import logging
from pathlib import Path

Expand Down Expand Up @@ -53,12 +54,14 @@ def finetune_command(
),
dataset_root: str = typer.Option(
"", "--dataset-root",
help="Actual EXPORT/dataset directory from a qualified Studio SmolVLA export.",
help="Local LeRobot v3 dataset directory; validated offline before training.",
),
dataset_manifest_sha256: str = typer.Option(
"", "--dataset-manifest-sha256",
help="Canonical sibling export-receipt.json SHA-256 (excludes its sha256 field).",
),
dataset_content_sha256: str = typer.Option("", "--dataset-content-sha256", help="Expected local content manifest SHA-256."),
dataset_features: str = typer.Option("{}", "--dataset-features", help="Recipe expected LeRobot feature shapes as JSON."),
output: str = typer.Option(
...,
"--output",
Expand Down Expand Up @@ -143,13 +146,22 @@ def finetune_command(
from tether.finetune.config import FinetuneConfig
from tether.finetune.run import run_finetune

try:
expected_features = json.loads(dataset_features)
except ValueError as exc:
raise typer.BadParameter("dataset_features must be a JSON feature object", param_hint="--dataset-features") from exc
if not isinstance(expected_features, dict):
raise typer.BadParameter("dataset_features must be a JSON feature object", param_hint="--dataset-features")

cfg = FinetuneConfig(
base=base,
base_revision=base_revision or None,
dataset=dataset,
dataset_revision=dataset_revision or None,
dataset_root=Path(dataset_root) if dataset_root else None,
dataset_manifest_sha256=dataset_manifest_sha256 or None,
dataset_content_sha256=dataset_content_sha256 or None,
dataset_features=expected_features,
output=Path(output),
num_steps=num_steps,
batch_size=batch_size,
Expand Down
8 changes: 7 additions & 1 deletion src/tether/finetune/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,17 @@ class FinetuneConfig:
"""

dataset_root: Path | None = None
"""Actual EXPORT/dataset directory of a qualified local Studio export."""
"""Local LeRobot v3 directory, or a qualified Studio export dataset directory."""

dataset_manifest_sha256: str | None = None
"""Canonical sibling export-receipt.json digest, excluding its sha256 field."""

dataset_content_sha256: str | None = None
"""Optional expected SHA-256 of the local content manifest, checked before launch."""

dataset_features: dict[str, Any] = field(default_factory=dict)
"""Recipe expected features, keyed by LeRobot names with shapes."""

def __post_init__(self) -> None:
self.output = Path(self.output)
if self.dataset_root is not None:
Expand Down
Loading
Loading