Instructions to use tokimoa/smolvla-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use tokimoa/smolvla-mlx with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir smolvla-mlx tokimoa/smolvla-mlx
- LeRobot
How to use tokimoa/smolvla-mlx with LeRobot:
# 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]
# Launch finetuning on your dataset python lerobot/scripts/train.py \ --policy.path=tokimoa/smolvla-mlx \ --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
# 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=tokimoa/smolvla-mlx - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
smolvla-mlx
Hugging Faceのロボット基盤モデル smolVLA(450M・Vision-Language-Action)のApple Silicon(MLX)移植です。カメラ画像・言語指示・関節状態から50手先までのアクションチャンクを生成します。大規模GPUなしで、実機制御に十分な速度で動作します。
| 実行系 | 1チャンク(50手)生成 | ピークメモリ |
|---|---|---|
| 本移植(MLX) | 160ms(313 actions/s) | 1.6GB |
| PyTorch MPS(参照実装) | 263ms | |
| PyTorch CPU(参照実装) | 5,835ms |
同一入力・同一ノイズでPyTorch参照実装とコサイン類似度0.99994(50手×32次元・Euler 10ステップ通し)の出力一致を検証済みです。プレフィル→偶数層joint self-attention/奇数層cross-attentionの二相構造、fp32でのRoPE・attention計算まで参照実装を忠実に再現しています。
使い方
pip install mlx-vlm pillow transformers
hf download tokimoa/smolvla-mlx --local-dir smolvla-mlx
from smolvla_mlx import SmolVLAMLX
import numpy as np
model = SmolVLAMLX.from_pretrained("smolvla-mlx")
actions = model.predict(
images=[cam1, cam2, cam3], # HWC uint8(1〜3カメラ)
instruction="Pick up the red cube",
state=[0.1, -0.2, 0.3, 0.0, 0.5, 0.0], # 関節状態(実次元のまま)
) # -> (50, 6) アクションチャンク
CLIでも動きます。
python smolvla-mlx/smolvla_mlx.py --images cam0.png cam1.png cam2.png \
--instruction "pick up the red cube" --state 0,0,0,0,0,0
位置づけ
smolVLAはベースモデルであり、実タスクへの適用には手元のロボット(SO-101等)でのファインチューニングが前提です。学習はLeRobotで行い、Mac上での推論・検証・デモに本移植を使う構成を想定しています。ファインチューニング済み重み(同一アーキテクチャ)もmodel.safetensorsを差し替えれば動きます。
前処理(アスペクト維持リサイズ・左上パディング・[-1,1]正規化・言語トークナイズ・状態パディング)はランタイムに内蔵しており、追加コードなしで参照実装と同じ入力分布になります。
ライセンス
Apache-2.0(ベースモデルsmolvla_baseのライセンスを継承)
Developed by tokimoa
- Downloads last month
- 27
Model size
0.5B params
Tensor type
F32
·
BF16 ·
Hardware compatibility
Log In to add your hardware
Quantized
Model tree for tokimoa/smolvla-mlx
Base model
lerobot/smolvla_base