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)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("smolagents/SmolVLM2-2.2B-Instruct-Agentic-GUI") model = AutoModelForImageTextToText.from_pretrained("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?"} ] }, ] 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- 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
End of training
Browse files- README.md +5 -1
- all_results.json +5 -0
- config.json +1 -1
- eval_results.json +7 -0
README.md
CHANGED
|
@@ -1,9 +1,13 @@
|
|
| 1 |
---
|
| 2 |
base_model: HuggingFaceTB/SmolVLM2-2.2B-Instruct
|
|
|
|
| 3 |
library_name: transformers
|
| 4 |
model_name: SmolVLM2-2.2B-Instruct-Agentic-GUI
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
|
|
|
|
|
|
|
|
|
| 7 |
- trl
|
| 8 |
- sft
|
| 9 |
licence: license
|
|
@@ -11,7 +15,7 @@ licence: license
|
|
| 11 |
|
| 12 |
# Model Card for SmolVLM2-2.2B-Instruct-Agentic-GUI
|
| 13 |
|
| 14 |
-
This model is a fine-tuned version of [HuggingFaceTB/SmolVLM2-2.2B-Instruct](https://huggingface.co/HuggingFaceTB/SmolVLM2-2.2B-Instruct).
|
| 15 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 16 |
|
| 17 |
## Quick start
|
|
|
|
| 1 |
---
|
| 2 |
base_model: HuggingFaceTB/SmolVLM2-2.2B-Instruct
|
| 3 |
+
datasets: smolagents/aguvis-stage-2
|
| 4 |
library_name: transformers
|
| 5 |
model_name: SmolVLM2-2.2B-Instruct-Agentic-GUI
|
| 6 |
tags:
|
| 7 |
- generated_from_trainer
|
| 8 |
+
- open-r1
|
| 9 |
+
- vision-language
|
| 10 |
+
- vlm
|
| 11 |
- trl
|
| 12 |
- sft
|
| 13 |
licence: license
|
|
|
|
| 15 |
|
| 16 |
# Model Card for SmolVLM2-2.2B-Instruct-Agentic-GUI
|
| 17 |
|
| 18 |
+
This 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.
|
| 19 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 20 |
|
| 21 |
## Quick start
|
all_results.json
CHANGED
|
@@ -1,4 +1,9 @@
|
|
| 1 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
"total_flos": 6033817814958080.0,
|
| 3 |
"train_loss": 0.6046972061422738,
|
| 4 |
"train_runtime": 27367.7567,
|
|
|
|
| 1 |
{
|
| 2 |
+
"eval_loss": 0.497082382440567,
|
| 3 |
+
"eval_runtime": 148.4737,
|
| 4 |
+
"eval_samples": 3639,
|
| 5 |
+
"eval_samples_per_second": 24.509,
|
| 6 |
+
"eval_steps_per_second": 0.768,
|
| 7 |
"total_flos": 6033817814958080.0,
|
| 8 |
"train_loss": 0.6046972061422738,
|
| 9 |
"train_runtime": 27367.7567,
|
config.json
CHANGED
|
@@ -119,7 +119,7 @@
|
|
| 119 |
"tie_word_embeddings": false,
|
| 120 |
"torch_dtype": "bfloat16",
|
| 121 |
"transformers_version": "4.52.3",
|
| 122 |
-
"use_cache":
|
| 123 |
"use_reentrant_checkpointing": false,
|
| 124 |
"vision_config": {
|
| 125 |
"attention_dropout": 0.0,
|
|
|
|
| 119 |
"tie_word_embeddings": false,
|
| 120 |
"torch_dtype": "bfloat16",
|
| 121 |
"transformers_version": "4.52.3",
|
| 122 |
+
"use_cache": true,
|
| 123 |
"use_reentrant_checkpointing": false,
|
| 124 |
"vision_config": {
|
| 125 |
"attention_dropout": 0.0,
|
eval_results.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"eval_loss": 0.497082382440567,
|
| 3 |
+
"eval_runtime": 148.4737,
|
| 4 |
+
"eval_samples": 3639,
|
| 5 |
+
"eval_samples_per_second": 24.509,
|
| 6 |
+
"eval_steps_per_second": 0.768
|
| 7 |
+
}
|