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 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
amir.mahla@huggingface.co commited on
Commit ·
32624be
1
Parent(s): e7129dd
PUSH last checkpoint
Browse files- README.md +3 -6
- all_results.json +11 -11
- eval_results.json +5 -5
- model.safetensors +1 -1
- train_results.json +6 -6
- trainer_state.json +0 -0
- training_args.bin +2 -2
README.md
CHANGED
|
@@ -1,18 +1,15 @@
|
|
| 1 |
---
|
| 2 |
datasets: smolagents/aguvis-stage-2
|
| 3 |
library_name: transformers
|
| 4 |
-
model_name: SmolVLM2-2.2B-Instruct-Agentic-GUI
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
| 7 |
- open-r1
|
| 8 |
- vision-language
|
| 9 |
- vlm
|
| 10 |
-
- trl
|
| 11 |
-
- sft
|
| 12 |
licence: license
|
| 13 |
---
|
| 14 |
|
| 15 |
-
# Model Card for
|
| 16 |
|
| 17 |
This model is a fine-tuned version of [None](https://huggingface.co/None) on the [smolagents/aguvis-stage-2](https://huggingface.co/datasets/smolagents/aguvis-stage-2) dataset.
|
| 18 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
|
@@ -23,14 +20,14 @@ It has been trained using [TRL](https://github.com/huggingface/trl).
|
|
| 23 |
from transformers import pipeline
|
| 24 |
|
| 25 |
question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
|
| 26 |
-
generator = pipeline("text-generation", model="
|
| 27 |
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
| 28 |
print(output["generated_text"])
|
| 29 |
```
|
| 30 |
|
| 31 |
## Training procedure
|
| 32 |
|
| 33 |
-
[<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/
|
| 34 |
|
| 35 |
|
| 36 |
This model was trained with SFT.
|
|
|
|
| 1 |
---
|
| 2 |
datasets: smolagents/aguvis-stage-2
|
| 3 |
library_name: transformers
|
|
|
|
| 4 |
tags:
|
| 5 |
- generated_from_trainer
|
| 6 |
- open-r1
|
| 7 |
- vision-language
|
| 8 |
- vlm
|
|
|
|
|
|
|
| 9 |
licence: license
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Model Card for None
|
| 13 |
|
| 14 |
This model is a fine-tuned version of [None](https://huggingface.co/None) on the [smolagents/aguvis-stage-2](https://huggingface.co/datasets/smolagents/aguvis-stage-2) dataset.
|
| 15 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
|
|
|
| 20 |
from transformers import pipeline
|
| 21 |
|
| 22 |
question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
|
| 23 |
+
generator = pipeline("text-generation", model="None", device="cuda")
|
| 24 |
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
| 25 |
print(output["generated_text"])
|
| 26 |
```
|
| 27 |
|
| 28 |
## Training procedure
|
| 29 |
|
| 30 |
+
[<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/9jig6y4c)
|
| 31 |
|
| 32 |
|
| 33 |
This model was trained with SFT.
|
all_results.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
{
|
| 2 |
-
"eval_loss": 0.
|
| 3 |
-
"eval_runtime":
|
| 4 |
-
"eval_samples":
|
| 5 |
-
"eval_samples_per_second":
|
| 6 |
-
"eval_steps_per_second": 0.
|
| 7 |
-
"total_flos":
|
| 8 |
-
"train_loss": 0.
|
| 9 |
-
"train_runtime":
|
| 10 |
-
"train_samples":
|
| 11 |
-
"train_samples_per_second": 14.
|
| 12 |
-
"train_steps_per_second": 0.
|
| 13 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"eval_loss": 0.4539664685726166,
|
| 3 |
+
"eval_runtime": 141.8302,
|
| 4 |
+
"eval_samples": 3638,
|
| 5 |
+
"eval_samples_per_second": 25.65,
|
| 6 |
+
"eval_steps_per_second": 0.804,
|
| 7 |
+
"total_flos": 9795365997903872.0,
|
| 8 |
+
"train_loss": 0.5166227378120477,
|
| 9 |
+
"train_runtime": 48333.5779,
|
| 10 |
+
"train_samples": 360073,
|
| 11 |
+
"train_samples_per_second": 14.899,
|
| 12 |
+
"train_steps_per_second": 0.029
|
| 13 |
}
|
eval_results.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
-
"eval_loss": 0.
|
| 3 |
-
"eval_runtime":
|
| 4 |
-
"eval_samples":
|
| 5 |
-
"eval_samples_per_second":
|
| 6 |
-
"eval_steps_per_second": 0.
|
| 7 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"eval_loss": 0.4539664685726166,
|
| 3 |
+
"eval_runtime": 141.8302,
|
| 4 |
+
"eval_samples": 3638,
|
| 5 |
+
"eval_samples_per_second": 25.65,
|
| 6 |
+
"eval_steps_per_second": 0.804
|
| 7 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4493654912
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f35a1d63b330152bc12ccb0685c77ca95a832992639eff97e5ec51473d249d5
|
| 3 |
size 4493654912
|
train_results.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
{
|
| 2 |
-
"total_flos":
|
| 3 |
-
"train_loss": 0.
|
| 4 |
-
"train_runtime":
|
| 5 |
-
"train_samples":
|
| 6 |
-
"train_samples_per_second": 14.
|
| 7 |
-
"train_steps_per_second": 0.
|
| 8 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"total_flos": 9795365997903872.0,
|
| 3 |
+
"train_loss": 0.5166227378120477,
|
| 4 |
+
"train_runtime": 48333.5779,
|
| 5 |
+
"train_samples": 360073,
|
| 6 |
+
"train_samples_per_second": 14.899,
|
| 7 |
+
"train_steps_per_second": 0.029
|
| 8 |
}
|
trainer_state.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:11aab7e60c1e4b330194483ff537da7366acadb2c5dceb7c17da2174c696abd3
|
| 3 |
+
size 7608
|