Image-Text-to-Text
Transformers
Safetensors
smolvlm
Generated from Trainer
open-r1
vision-language
vlm
conversational
Instructions to use smolagents/SmolVLM2-2.2B-Instruct-Agentic-GUI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use smolagents/SmolVLM2-2.2B-Instruct-Agentic-GUI with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="smolagents/SmolVLM2-2.2B-Instruct-Agentic-GUI") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("smolagents/SmolVLM2-2.2B-Instruct-Agentic-GUI") model = AutoModelForMultimodalLM.from_pretrained("smolagents/SmolVLM2-2.2B-Instruct-Agentic-GUI", device_map="auto") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use smolagents/SmolVLM2-2.2B-Instruct-Agentic-GUI with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "smolagents/SmolVLM2-2.2B-Instruct-Agentic-GUI" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "smolagents/SmolVLM2-2.2B-Instruct-Agentic-GUI", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/smolagents/SmolVLM2-2.2B-Instruct-Agentic-GUI
- SGLang
How to use smolagents/SmolVLM2-2.2B-Instruct-Agentic-GUI with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "smolagents/SmolVLM2-2.2B-Instruct-Agentic-GUI" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "smolagents/SmolVLM2-2.2B-Instruct-Agentic-GUI", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "smolagents/SmolVLM2-2.2B-Instruct-Agentic-GUI" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "smolagents/SmolVLM2-2.2B-Instruct-Agentic-GUI", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use smolagents/SmolVLM2-2.2B-Instruct-Agentic-GUI with Docker Model Runner:
docker model run hf.co/smolagents/SmolVLM2-2.2B-Instruct-Agentic-GUI
Model save
Browse filesFiles changed (11)
123456789101112131 unmodified line151617181920219 unmodified lines313233343536371 unmodified line39404142434445---base_model: HuggingFaceTB/SmolVLM2-2.2B-Instructdatasets: smolagents/aguvis-stage-2library_name: transformersmodel_name: SmolVLM2-2.2B-Instruct-Agentic-GUItags:- generated_from_trainer- open-r1- vision-language- vlm- trl- sftlicence: license1 unmodified line# Model Card for SmolVLM2-2.2B-Instruct-Agentic-GUIThis model is a fine-tuned version of [HuggingFaceTB/SmolVLM2-2.2B-Instruct](https://huggingface.co/HuggingFaceTB/SmolVLM2-2.2B-Instruct) on the [smolagents/aguvis-stage-2](https://huggingface.co/datasets/smolagents/aguvis-stage-2) dataset.It has been trained using [TRL](https://github.com/huggingface/trl).## Quick start9 unmodified lines## Training procedure[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/huggingface/smolagents/runs/3tovwz1m)This model was trained with SFT.1 unmodified line### Framework versions- TRL: 0.18.0- Transformers: 4.52.3- Pytorch: 2.6.0- Datasets: 4.0.0- Tokenizers: 0.21.2123456781 unmodified line101112131415169 unmodified lines262728293031321 unmodified line34353637383940---library_name: transformersmodel_name: SmolVLM2-2.2B-Instruct-Agentic-GUItags:- generated_from_trainer- trl- sftlicence: license1 unmodified line# Model Card for SmolVLM2-2.2B-Instruct-Agentic-GUIThis model is a fine-tuned version of [None](https://huggingface.co/None).It has been trained using [TRL](https://github.com/huggingface/trl).## Quick start9 unmodified lines## Training procedure[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/huggingface/smolagents/runs/fafnjj0e)This model was trained with SFT.1 unmodified line### Framework versions- TRL: 0.18.0- Transformers: 4.54.1- Pytorch: 2.6.0- Datasets: 4.0.0- Tokenizers: 0.21.2
12345678910111213{"eval_loss": 0.5039201974868774,"eval_runtime": 159.8129,"eval_samples": 3639,"eval_samples_per_second": 22.77,"eval_steps_per_second": 0.713,"total_flos": 6035679775555584.0,"train_loss": 0.6108774590221319,"train_runtime": 28363.9285,"train_samples": 360252,"train_samples_per_second": 12.701,"train_steps_per_second": 0.025}12345678{"total_flos": 1.0314062938243072e+16,"train_loss": 0.7184352108531378,"train_runtime": 49977.4428,"train_samples": 360255,"train_samples_per_second": 14.417,"train_steps_per_second": 0.028}
27 unmodified lines28293031323384 unmodified lines11811912012112212312412527 unmodified lines"num_key_value_heads": 32,"pad_token_id": 2,"perceiver_config": {"_name_or_path": "","add_cross_attention": false,"architectures": null,84 unmodified lines},"tie_word_embeddings": false,"torch_dtype": "bfloat16","transformers_version": "4.52.3","use_cache": true,"use_reentrant_checkpointing": false,"vision_config": {"attention_dropout": 0.0,27 unmodified lines2829303132333484 unmodified lines11912012112212312412512627 unmodified lines"num_key_value_heads": 32,"pad_token_id": 2,"perceiver_config": {"_attn_implementation_autoset": false,"_name_or_path": "","add_cross_attention": false,"architectures": null,84 unmodified lines},"tie_word_embeddings": false,"torch_dtype": "bfloat16","transformers_version": "4.54.1","use_cache": false,"use_reentrant_checkpointing": false,"vision_config": {"attention_dropout": 0.0,
2 unmodified lines345672 unmodified lines"bos_token_id": 0,"eos_token_id": 49279,"pad_token_id": 2,"transformers_version": "4.52.3"}2 unmodified lines345672 unmodified lines"bos_token_id": 0,"eos_token_id": 49279,"pad_token_id": 2,"transformers_version": "4.54.1"}
123version https://git-lfs.github.com/spec/v1oid sha256:a1ff4e9a48bb15f355ba0e6c47d0a2b3aff2874813d04aa0b19b84ecfa6faa6fsize 4493654912123version https://git-lfs.github.com/spec/v1oid sha256:a0cc2775f67a58f2f49f72ee3cda5e75dcec41726d4248ab1590904f3957bac8size 4493654912
22 unmodified lines2324252627282922 unmodified lines"resample": 1,"rescale_factor": 0.00392156862745098,"size": {"longest_edge": 1536},"video_sampling": {"fps": 1,22 unmodified lines2324252627282922 unmodified lines"resample": 1,"rescale_factor": 0.00392156862745098,"size": {"longest_edge": 1152},"video_sampling": {"fps": 1,
1167 unmodified lines116811691170117111721173117411 unmodified lines11861187118811891190119111921167 unmodified lines"<end_of_utterance>"],"bos_token": "<|im_start|>","chat_template": "<|im_start|>{% for message in messages %}{{message['role'] | capitalize}}{% if message['content'][0]['type'] == 'image' %}{{':'}}{% else %}{{': '}}{% endif %}{% for line in message['content'] %}{% if line['type'] == 'text' %}{{line['text']}}{% elif line['type'] == 'image' %}{{ '<image>' }}{% endif %}{% endfor %}<end_of_utterance>\n{% endfor %}{% if add_generation_prompt %}{{ 'Assistant:' }}{% endif %}","clean_up_tokenization_spaces": false,"end_of_utterance_token": "<end_of_utterance>","eos_token": "<end_of_utterance>",11 unmodified lines"pad_token": "<|im_end|>","processor_class": "SmolVLMProcessor","tokenizer_class": "GPT2Tokenizer","truncation_side": "left","unk_token": "<|endoftext|>","vocab_size": 49152}1167 unmodified lines11681169117011711172117311 unmodified lines11851186118711881189119011911167 unmodified lines"<end_of_utterance>"],"bos_token": "<|im_start|>","clean_up_tokenization_spaces": false,"end_of_utterance_token": "<end_of_utterance>","eos_token": "<end_of_utterance>",11 unmodified lines"pad_token": "<|im_end|>","processor_class": "SmolVLMProcessor","tokenizer_class": "GPT2Tokenizer","truncation_side": "right","unk_token": "<|endoftext|>","vocab_size": 49152}
12345678{"total_flos": 6035679775555584.0,"train_loss": 0.6108774590221319,"train_runtime": 28363.9285,"train_samples": 360252,"train_samples_per_second": 12.701,"train_steps_per_second": 0.025}12345678{"total_flos": 1.0314062938243072e+16,"train_loss": 0.7184352108531378,"train_runtime": 49977.4428,"train_samples": 360255,"train_samples_per_second": 14.417,"train_steps_per_second": 0.028}
123version https://git-lfs.github.com/spec/v1oid sha256:2cf8d5a1e138db8da5110cdc8f79475dd99f6c4ce73eeca4b7e8f2e08f704711size 7544123version https://git-lfs.github.com/spec/v1oid sha256:a8a6aaab234537ac22f6e654d93a1438177e55229767e5163fa09044f87b23b7size 7544
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647{ "crop_size": null, "data_format": "channels_first", "default_to_square": true, "device": null, "do_center_crop": null, "do_convert_rgb": true, "do_image_splitting": true, "do_normalize": true, "do_pad": true, "do_rescale": true, "do_resize": true, "do_sample_frames": false, "fps": 1, "image_mean": [ 0.5, 0.5, 0.5 ], "image_processor_type": "SmolVLMImageProcessor", "image_std": [ 0.5, 0.5, 0.5 ], "input_data_format": null, "max_image_size": { "longest_edge": 384 }, "num_frames": 64, "processor_class": "SmolVLMProcessor", "resample": 1, "rescale_factor": 0.00392156862745098, "size": { "longest_edge": 1536 }, "size_divisor": null, "video_metadata": null, "video_processor_type": "SmolVLMVideoProcessor", "video_sampling": { "fps": 1, "max_frames": 64, "video_size": { "longest_edge": 1536 } }}README.md+3-8
all_results.json+6-11
config.json+3-2
generation_config.json+1-1
model.safetensors+1-1
preprocessor_config.json+1-1
tokenizer_config.json+1-2
train_results.json+6-6
trainer_state.json
training_args.bin+1-1
video_preprocessor_config.jsonAdded+47