Downloads · 30 days
290
12% of all-time downloads
infil00p/nanoVLM-230M-8k-executorch
nanoVLM-230M-8k-executorch is a machine learning model from infil00p. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for executorch. The card lists the license as apache-2.0.
This repository contains the ExecuTorch (.pte) export of nanoVLM, optimized for on-device inference.
Downloads · 30 days
290
12% of all-time downloads
All-time downloads
2.5K
Public
Repo size
3.6 GB
Likes
0
Public
Click a slice to open those files.
.pte1.1 GB · 100%
From the Hugging Face model README
This repository contains the ExecuTorch (.pte) export of nanoVLM, optimized for on-device inference.
vision_encoder.pte - Vision encoder (SigLIP-B/16)modality_projector.pte - Projects vision features to language spacelanguage_decoder_prefill.pte - Language decoder prefill phaselanguage_decoder_decode.pte - Language decoder decode phase with KV cachetoken_embedding.pte - Token embedding lookuplm_head.pte - Language model output headconfig.json - Model configuration# Install dependencies
pip install executorch torch pillow transformers
# Download model
huggingface-cli download infil00p/nanoVLM-230M-8k-executorch --local-dir executorch_models
# Clone nanoVLM repo for test script
git clone https://github.com/huggingface/nanoVLM
cd nanoVLM
# Run inference test
python test_executorch_pte.py --model_dir ../executorch_models --image assets/image.png
from executorch.extension.pybindings.portable_lib import _load_for_executorch
import torch
# Load models
vision_encoder = _load_for_executorch("vision_encoder.pte")
modality_projector = _load_for_executorch("modality_projector.pte")
prefill_decoder = _load_for_executorch("language_decoder_prefill.pte")
decode_decoder = _load_for_executorch("language_decoder_decode.pte")
token_embedding = _load_for_executorch("token_embedding.pte")
lm_head = _load_for_executorch("lm_head.pte")
# Run inference (see test_executorch_pte.py for full example)
# 1. Encode image with vision_encoder
# 2. Project with modality_projector
# 3. Combine with text embeddings from token_embedding
# 4. Run prefill_decoder for initial KV cache
# 5. Autoregressive decode with decode_decoder
# 6. Get logits with lm_head
For a complete working implementation, see test_executorch_pte.py in the nanoVLM repository.
Test Results:
Example output:
"A close-up photograph captures a tabby cat with a focused gaze, sitting on a patterned surface. The cat's fur exhibits a mix of dark..."
Quantization Impact:
Exported using:
python export_executorch.py --checkpoint lusxvr/nanoVLM --output_dir executorch_models --quantize
torchaoApache 2.0