diff --git a/packages/tasks/src/model-libraries-snippets.ts b/packages/tasks/src/model-libraries-snippets.ts index fbcd0d6475..a5e63fae65 100644 --- a/packages/tasks/src/model-libraries-snippets.ts +++ b/packages/tasks/src/model-libraries-snippets.ts @@ -762,6 +762,47 @@ print(output)`); return snippets; }; +export const lerobot = (model: ModelData): string[] => { + if (model.tags.includes("smolvla")) { + const smolvlaSnippets = [ + // Installation snippet + `# See https://github.com/huggingface/lerobot?tab=readme-ov-file#installation for more details +git clone https://github.com/huggingface/lerobot.git +cd lerobot +pip install -e .[smolvla]`, + // Finetune snippet + `# Launch finetuning on your dataset +python lerobot/scripts/train.py \\ +--policy.path=${model.id} \\ +--dataset.repo_id=lerobot/svla_so101_pickplace \\ +--batch_size=64 \\ +--steps=20000 \\ +--output_dir=outputs/train/my_smolvla \\ +--job_name=my_smolvla_training \\ +--policy.device=cuda \\ +--wandb.enable=true`, + ]; + if (model.id !== "lerobot/smolvla_base") { + // Inference snippet (only if not base model) + smolvlaSnippets.push( + `# Run the policy using the record function +python -m lerobot.record \\ + --robot.type=so101_follower \\ + --robot.port=/dev/ttyACM0 \\ # <- Use your port + --robot.id=my_blue_follower_arm \\ # <- Use your robot id + --robot.cameras="{ front: {type: opencv, index_or_path: 8, width: 640, height: 480, fps: 30}}" \\ # <- Use your cameras + --dataset.single_task="Grasp a lego block and put it in the bin." \\ # <- Use the same task description you used in your dataset recording + --dataset.repo_id=HF_USER/dataset_name \\ # <- This will be the dataset name on HF Hub + --dataset.episode_time_s=50 \\ + --dataset.num_episodes=10 \\ + --policy.path=${model.id}` + ); + } + return smolvlaSnippets; + } + return []; +}; + export const tf_keras = (model: ModelData): string[] => [ `# Note: 'keras<3.x' or 'tf_keras' must be installed (legacy) # See https://github.com/keras-team/tf-keras for more details. diff --git a/packages/tasks/src/model-libraries.ts b/packages/tasks/src/model-libraries.ts index f70786a858..056463f205 100644 --- a/packages/tasks/src/model-libraries.ts +++ b/packages/tasks/src/model-libraries.ts @@ -527,6 +527,14 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = { filter: false, countDownloads: `path_extension:"litertlm"`, }, + lerobot: { + prettyLabel: "LeRobot", + repoName: "LeRobot", + repoUrl: "https://github.com/huggingface/lerobot", + docsUrl: "https://huggingface.co/docs/lerobot", + filter: false, + snippets: snippets.lerobot, + }, liveportrait: { prettyLabel: "LivePortrait", repoName: "LivePortrait",