Skip to content

feat(datasets): edit an episode's task in the dataset browser - #144

Open
ravediamond wants to merge 1 commit into
huggingface:mainfrom
ravediamond:feat/relabel-task
Open

ravediamond wants to merge 1 commit into
huggingface:mainfrom
ravediamond:feat/relabel-task

Conversation

@ravediamond

Copy link
Copy Markdown
Contributor

Problem

The task string is what a language-conditioned policy (SmolVLA, PI0) is trained on, and it is typed once when recording starts. A typo, a vague instruction, or one take of a different task recorded under the wrong label currently means leaving LeLab for lerobot-edit-dataset --operation.type modify_tasks.

Approach

A small pencil on the selected row of the episode list (local datasets only) opens an "Edit task" dialog, prefilled with that episode's task. Save sets it for that episode, or for every episode with "Apply to all N episodes".

  • POST /datasets/episode-task wraps LeRobot's modify_tasks. That function rewrites meta/ and data/ in place, so it runs on a staged copy next to the dataset, swapped in once it succeeds: a failure leaves the source untouched. Only meta/ and data/ are copied; videos and images are hard-linked into the copy (falling back to a copy on filesystems without hard links), so the edit does not duplicate footage.
  • 409 while a recording is running, 422 for an empty task or a negative index at the request model, 400 for an episode not in the dataset. ensure_episode_index runs before the dataset is opened.
  • Episode indices do not change, so nothing cached by the browser goes stale.

This overlaps #142 in two small places: the same refresh added to useEpisodes and the same _record_dataset / _episode_tasks test helpers. Whichever lands second, I'll rebase.

Testing

  • pytest: relabel one episode and every episode on a LeRobot-written dataset (checking that a video file keeps its inode), invalid requests, a failure after modify_tasks ran that leaves the source untouched, the 409 while recording, request validation.
  • vitest for the dialog, eslint, npm run build, pre-commit run --all-files.
  • Drove it end to end in headless Chromium on a small recorded video dataset: the list shows the new task, the mp4 is the same inode afterwards, frames still decode, no staging dir left behind.

Tested on Linux (Jetson Orin, aarch64) only. Not tested on macOS, Windows, or a real SO-101 dataset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant