mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-23 20:50:02 +00:00
chore(evo1): align with policy contribution guide conventions
- Add `src/lerobot/policies/evo1/README.md` symlink into `docs/source/evo1.mdx` to match the in-tree README convention (mirroring the EO-1 layout). - Convert `transformers` import in `internvl3_embedder.py` to the standard `TYPE_CHECKING + _transformers_available` two-step gating used by other optional-backbone policies (e.g. diffusion). The previous lazy-in-`__init__` import was functionally equivalent for runtime gating but didn't expose the real symbols to type checkers. - Add `lerobot[evo1]` to the `all` extra in `pyproject.toml` so `pip install 'lerobot[all]'` keeps installing every optional policy. Per the guidance in https://moon-ci-docs.huggingface.co/docs/lerobot/pr_3534/en/contributing_a_policy.
This commit is contained in:
@@ -259,6 +259,7 @@ all = [
|
|||||||
"lerobot[smolvla]",
|
"lerobot[smolvla]",
|
||||||
# "lerobot[groot]", TODO(Steven): Gr00t requires specific installation instructions for flash-attn
|
# "lerobot[groot]", TODO(Steven): Gr00t requires specific installation instructions for flash-attn
|
||||||
"lerobot[xvla]",
|
"lerobot[xvla]",
|
||||||
|
"lerobot[evo1]",
|
||||||
"lerobot[hilserl]",
|
"lerobot[hilserl]",
|
||||||
"lerobot[async]",
|
"lerobot[async]",
|
||||||
"lerobot[dev]",
|
"lerobot[dev]",
|
||||||
|
|||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
../../../../docs/source/evo1.mdx
|
||||||
@@ -17,6 +17,7 @@ from __future__ import annotations
|
|||||||
import functools
|
import functools
|
||||||
import logging
|
import logging
|
||||||
from collections.abc import Sequence
|
from collections.abc import Sequence
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
import torch.nn as nn
|
import torch.nn as nn
|
||||||
@@ -24,7 +25,13 @@ import torchvision.transforms.functional as TF
|
|||||||
from PIL import Image
|
from PIL import Image
|
||||||
from torchvision.transforms.functional import to_pil_image
|
from torchvision.transforms.functional import to_pil_image
|
||||||
|
|
||||||
from lerobot.utils.import_utils import require_package
|
from lerobot.utils.import_utils import _transformers_available, require_package
|
||||||
|
|
||||||
|
if TYPE_CHECKING or _transformers_available:
|
||||||
|
from transformers import AutoModel, AutoTokenizer
|
||||||
|
else:
|
||||||
|
AutoModel = None
|
||||||
|
AutoTokenizer = None
|
||||||
|
|
||||||
IMAGENET_MEAN = (0.485, 0.456, 0.406)
|
IMAGENET_MEAN = (0.485, 0.456, 0.406)
|
||||||
IMAGENET_STD = (0.229, 0.224, 0.225)
|
IMAGENET_STD = (0.229, 0.224, 0.225)
|
||||||
@@ -111,7 +118,6 @@ class InternVL3Embedder(nn.Module):
|
|||||||
self.gradient_checkpointing_use_reentrant = bool(gradient_checkpointing_use_reentrant)
|
self.gradient_checkpointing_use_reentrant = bool(gradient_checkpointing_use_reentrant)
|
||||||
|
|
||||||
require_package("transformers", extra="evo1")
|
require_package("transformers", extra="evo1")
|
||||||
from transformers import AutoModel, AutoTokenizer
|
|
||||||
|
|
||||||
self.tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True, use_fast=False)
|
self.tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True, use_fast=False)
|
||||||
if isinstance(model_dtype, str):
|
if isinstance(model_dtype, str):
|
||||||
|
|||||||
@@ -3079,6 +3079,7 @@ requires-dist = [
|
|||||||
{ name = "lerobot", extras = ["diffusers-dep"], marker = "extra == 'multi-task-dit'" },
|
{ name = "lerobot", extras = ["diffusers-dep"], marker = "extra == 'multi-task-dit'" },
|
||||||
{ name = "lerobot", extras = ["diffusion"], marker = "extra == 'all'" },
|
{ name = "lerobot", extras = ["diffusion"], marker = "extra == 'all'" },
|
||||||
{ name = "lerobot", extras = ["dynamixel"], marker = "extra == 'all'" },
|
{ name = "lerobot", extras = ["dynamixel"], marker = "extra == 'all'" },
|
||||||
|
{ name = "lerobot", extras = ["evo1"], marker = "extra == 'all'" },
|
||||||
{ name = "lerobot", extras = ["feetech"], marker = "extra == 'all'" },
|
{ name = "lerobot", extras = ["feetech"], marker = "extra == 'all'" },
|
||||||
{ name = "lerobot", extras = ["feetech"], marker = "extra == 'hopejr'" },
|
{ name = "lerobot", extras = ["feetech"], marker = "extra == 'hopejr'" },
|
||||||
{ name = "lerobot", extras = ["feetech"], marker = "extra == 'lekiwi'" },
|
{ name = "lerobot", extras = ["feetech"], marker = "extra == 'lekiwi'" },
|
||||||
|
|||||||
Reference in New Issue
Block a user