Instructions to use Agents-X/PyVision-Image-7B-SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Agents-X/PyVision-Image-7B-SFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Agents-X/PyVision-Image-7B-SFT") 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("Agents-X/PyVision-Image-7B-SFT") model = AutoModelForImageTextToText.from_pretrained("Agents-X/PyVision-Image-7B-SFT") 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 Agents-X/PyVision-Image-7B-SFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Agents-X/PyVision-Image-7B-SFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Agents-X/PyVision-Image-7B-SFT", "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/Agents-X/PyVision-Image-7B-SFT
- SGLang
How to use Agents-X/PyVision-Image-7B-SFT 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 "Agents-X/PyVision-Image-7B-SFT" \ --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": "Agents-X/PyVision-Image-7B-SFT", "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 "Agents-X/PyVision-Image-7B-SFT" \ --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": "Agents-X/PyVision-Image-7B-SFT", "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 Agents-X/PyVision-Image-7B-SFT with Docker Model Runner:
docker model run hf.co/Agents-X/PyVision-Image-7B-SFT
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,61 +1,19 @@
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
-
license: other
|
| 4 |
base_model: Qwen/Qwen2.5-VL-7B-Instruct
|
| 5 |
-
tags:
|
| 6 |
-
- llama-factory
|
| 7 |
-
- full
|
| 8 |
-
- generated_from_trainer
|
| 9 |
model-index:
|
| 10 |
- name: sft
|
| 11 |
results: []
|
| 12 |
---
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
## Intended uses & limitations
|
| 26 |
-
|
| 27 |
-
More information needed
|
| 28 |
-
|
| 29 |
-
## Training and evaluation data
|
| 30 |
-
|
| 31 |
-
More information needed
|
| 32 |
-
|
| 33 |
-
## Training procedure
|
| 34 |
-
|
| 35 |
-
### Training hyperparameters
|
| 36 |
-
|
| 37 |
-
The following hyperparameters were used during training:
|
| 38 |
-
- learning_rate: 1e-05
|
| 39 |
-
- train_batch_size: 1
|
| 40 |
-
- eval_batch_size: 8
|
| 41 |
-
- seed: 42
|
| 42 |
-
- distributed_type: multi-GPU
|
| 43 |
-
- num_devices: 8
|
| 44 |
-
- gradient_accumulation_steps: 2
|
| 45 |
-
- total_train_batch_size: 16
|
| 46 |
-
- total_eval_batch_size: 64
|
| 47 |
-
- optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 48 |
-
- lr_scheduler_type: cosine
|
| 49 |
-
- lr_scheduler_warmup_ratio: 0.1
|
| 50 |
-
- num_epochs: 1.0
|
| 51 |
-
|
| 52 |
-
### Training results
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
### Framework versions
|
| 57 |
-
|
| 58 |
-
- Transformers 4.51.3
|
| 59 |
-
- Pytorch 2.5.1+cu121
|
| 60 |
-
- Datasets 3.6.0
|
| 61 |
-
- Tokenizers 0.21.1
|
|
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
|
|
|
| 3 |
base_model: Qwen/Qwen2.5-VL-7B-Instruct
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
model-index:
|
| 5 |
- name: sft
|
| 6 |
results: []
|
| 7 |
---
|
| 8 |
+
[PyVision-RL: Forging Open Agentic Vision Models via RL](https://arxiv.org/abs/2602.20739)
|
| 9 |
+
|
| 10 |
+
This is PyVision-Image-7B-SFT, post trained from Qwen2.5-VL-7B.
|
| 11 |
+
|
| 12 |
+
```bibtex
|
| 13 |
+
@article{pyvisionrl2026,
|
| 14 |
+
title={PyVision-RL: Forging Open Agentic Vision Models via RL},
|
| 15 |
+
author={Zhao, Shitian and Lin, Shaoheng and Li, Ming and Zhang, Haoquan and Peng, Wenshuo and Zhang, Kaipeng and Wei, Chen},
|
| 16 |
+
journal={arXiv:2602.20739},
|
| 17 |
+
year={2026}
|
| 18 |
+
}
|
| 19 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|