Prompt to install policy extras (smolvla/pi0/diffusion) before training starts#45
Open
nobullryder wants to merge 1 commit into
Open
Prompt to install policy extras (smolvla/pi0/diffusion) before training starts#45nobullryder wants to merge 1 commit into
nobullryder wants to merge 1 commit into
Conversation
…ore training
Training a policy that needs an optional LeRobot extra fails with a buried
ImportError only after the training subprocess has already started (smolvla/pi0/
pi0_fast need transformers; diffusion needs diffusers).
Add a pre-flight that reuses the existing install-extra machinery:
- GET /system/policy-extra/{policy_type} does a live importlib.find_spec probe
and returns the pip target; POST .../install and GET .../install-status reuse
the existing InstallManager. pi0 and pi0_fast share lerobot[pi]; core policies
(act, vqbet, tdmpc, sac) report available.
- On Start Training the UI pre-flights the endpoint and, if the extra is missing,
opens PolicyExtraDialog (a parameterized sibling of WandbInstallDialog) for a
one-click install instead of starting the run.
Tests cover the policy->extra mapping, find_spec availability, the core-policy
no-op, and the GET route.
Note: restart LeLab after installing so the new package is importable.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Training a policy that pulls an optional LeRobot extra fails with a buried
ImportError— but only after the training subprocess has already started, so the user just sees the run die in the logs:smolvla,pi0, andpi0_fastneedtransformers;diffusionneedsdiffusers.What this does
A pre-flight check on Start Training, built entirely on the existing install-extra machinery (
InstallManager,useInstallExtra,InstallProgress,WandbInstallDialog) — no new infrastructure.GET /system/policy-extra/{policy_type}does a liveimportlib.util.find_specprobe and returns the install target.POST .../install+GET .../install-statusreuseInstallManagerto runpip install lerobot[<extra>]in the background.PolicyExtraDialog(a parameterized sibling ofWandbInstallDialog) for a one-click install instead of starting a run that's doomed to crash.smolvlatransformerslerobot[smolvla]pi0,pi0_fasttransformerslerobot[pi]diffusiondiffuserslerobot[diffusion]Tests
tests/test_utils_system.pycovers the policy→extra mapping, thefind_specavailability logic, the core-policy no-op, the install no-op, and theGET /system/policy-extra/{policy_type}route.Notes
frontend/distis included (built withnpm ciagainst the committed lockfile, matching thebuild_frontendworkflow) — please review the source files first.🤖 Generated with Claude Code