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
12 changes: 12 additions & 0 deletions frontend/src/components/landing/InferenceModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ test("an unsaved camera permits a manual rotation with a training-data reminder"
expect(request.cameras.wrist).toMatchObject({ camera_index: 3, rotation: 90, width: 640, height: 480 });
});

test("the plugin package note shows only for a policy type LeRobot does not register", async () => {
await render();
expect(container.textContent).not.toContain("plugin policy");
act(() => root.unmount()); root = createRoot(container);
const builtin = mocks.fetcher.getMockImplementation()!;
mocks.fetcher.mockImplementation(async (url: string, init?: RequestInit) => url.endsWith("/policy-config")
? new Response(JSON.stringify({ policy_type: "my_plugin", requires_task: true, image_features: {} }))
: builtin(url, init));
await render();
expect(container.textContent).toContain("This is a plugin policy");
});

test("an invalid saved rotation blocks inference and gives a visible correction instruction", async () => {
await render({ ...robot, cameras: [{ ...robot.cameras[0], rotation: 45 as never }] });
expect(container.textContent).toContain("Correct the camera settings in Calibration");
Expand Down
28 changes: 28 additions & 0 deletions frontend/src/components/landing/InferenceModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,28 @@ interface Props {
}

const DEFAULT_FPS = 30;
// Policy types LeRobot (v0.6.1) registers itself; any other type comes from a plugin package.
const BUILTIN_POLICY_TYPES = new Set([
"act",
"diffusion",
"eo1",
"evo1",
"fastwam",
"gaussian_actor",
"groot",
"lingbot_va",
"molmoact2",
"multi_task_dit",
"pi0",
"pi05",
"pi0_fast",
"smolvla",
"tdmpc",
"vla_jepa",
"vqbet",
"wall_x",
"xvla",
]);

const InferenceModal: React.FC<Props> = ({
open,
Expand Down Expand Up @@ -176,6 +198,12 @@ const InferenceModal: React.FC<Props> = ({
Pick a checkpoint and confirm hardware. The selected policy will
drive the follower autonomously for the configured duration.
</DialogDescription>
{policyConfig && !BUILTIN_POLICY_TYPES.has(policyConfig.policy_type ?? "") && (
<p className="text-xs text-gray-500 text-center -mt-3">
This is a plugin policy: its package must be installed alongside
lelab, or the run will fail to load the policy.
</p>
)}

<div className="space-y-4">
<h3 className="text-lg font-semibold text-white border-b border-gray-700 pb-2">
Expand Down
Loading