From fc4f6d2502a301cf2c5ad913fac2176919becea8 Mon Sep 17 00:00:00 2001 From: Pepijn Date: Tue, 28 Apr 2026 13:39:55 +0200 Subject: [PATCH] fix(annotate): default trust_remote_code=False for HF loaders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Setting trust_remote_code=True unconditionally pulled custom loader code that triggers std::bad_alloc post-load on Qwen3-VL — the official transformers class is sufficient. Flip the default to False; keep the config field so users can opt in for models that actually need it. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/lerobot/annotations/steerable_pipeline/config.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lerobot/annotations/steerable_pipeline/config.py b/src/lerobot/annotations/steerable_pipeline/config.py index 07326170e..347d75225 100644 --- a/src/lerobot/annotations/steerable_pipeline/config.py +++ b/src/lerobot/annotations/steerable_pipeline/config.py @@ -76,9 +76,12 @@ class VlmConfig: """Cap context length. ``None`` keeps the model's default; on H100 80 GB a 30B BF16 model often needs ``max_model_len=8192`` or smaller to leave room for KV cache.""" - trust_remote_code: bool = True - """Pass ``trust_remote_code`` to HF auto-classes. Required for many - newer VL checkpoints (Qwen3.x FP8, etc.) that ship custom loader code.""" + trust_remote_code: bool = False + """Pass ``trust_remote_code`` to HF auto-classes. Default ``False`` — + only enable for models that actually ship custom code in their repo + (rare for first-class VL releases). On Qwen3-VL it triggers an + std::bad_alloc post-load even though the official transformers class + is sufficient, so leaving this off is safest.""" camera_key: str | None = None """Override the camera stream used for keyframe attachment. ``None`` picks the first ``observation.images.*`` key the dataset declares."""