feat(inference): allow running a policy ref that isn't tied to a LeLab job - #114
Open
ravediamond wants to merge 1 commit into
Open
ravediamond wants to merge 1 commit into
ravediamond wants to merge 1 commit into
Conversation
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.
Closes #111.
lerobot already supports third-party policy plugins (a pip-installed
lerobot_policy_<name>package registers intoPreTrainedConfig's choice registry, andlerobot-rolloutalready callsregister_third_party_plugins()at startup) — and_resolve_policy_pathinlelab/rollout.pyalready accepts an arbitrary local checkpoint dir or Hub ref. The actual gap was the UI: the inference modal only ever builtpolicy_reffrom a job's own checkpoints, so there was no way to point at a checkpoint that isn't tied to a LeLab training run.Added a "Use a custom policy path or ref" toggle to the inference modal. When on, you type a local checkpoint directory or a Hub ref (same
user/repo@root/user/repo@checkpoints/000050shape as job checkpoints) instead of picking from the dropdown.New
GET /policy-config?policy_ref=endpoint reads that ref'sconfig.jsonand returns the same summary (policy type, expected cameras, whether it needs a task string) the job-checkpoint route already returns — pulled the shared extraction intojobs.summarize_policy_config()so both routes use the same logic.Known limitation, not fixed here:
requires_taskis driven by a hardcoded list of language-conditioned policy types (smolvla,pi0,pi0_fast,pi05). A plugin policy that needs a task string won't get the task input shown automatically — you can still type one, the field just won't appear on its own. Didn't want to guess at a convention for plugins to declare this.Tested: pytest (273 passed, 6 new tests), ruff check/format, tsc, eslint, prod build all clean. Not tested against a real third-party plugin package — don't have one installed to verify with.