FastVLM
Collection
FastVLM support transformers load. • 6 items • Updated
# Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("zhaode/FastVLM-7B-Stage2", trust_remote_code=True, dtype="auto")This is FastVLM-7B-Stage2, a multimodal language model that can understand things visually, being agentic, understand long videos and capture events, and generate structured outputs.
This model is exported from Github apple/ml-fastvlm.
Model's weight: llava-fastvithd_7b_stage2.zip.
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = 'FastVLM-7B-Stage2'
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True, use_fast=False)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype='auto', trust_remote_code=True)
git clone https://github.com/alibaba/MNN
cd MNN/transformers/llm/export
python llmexport.py --path /path/to/FastVLM-7B-Stage2 --export mnn
If you find our work helpful, feel free to give us a cite.
@InProceedings{fastvlm2025,
author = {Pavan Kumar Anasosalu Vasu, Fartash Faghri, Chun-Liang Li, Cem Koc, Nate True, Albert Antony, Gokul Santhanam, James Gabriel, Peter Grasch, Oncel Tuzel, Hadi Pouransari},
title = {FastVLM: Efficient Vision Encoding for Vision Language Models},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2025},
}{2023}
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="zhaode/FastVLM-7B-Stage2", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)