Image-Text-to-Text
Transformers
Safetensors
qwen2_5_vl
EVA
qwen2.5-vl
model-editing
ai-safety
jailbreak
defense
vision-language-model
conversational
text-generation-inference
Instructions to use wanglne/EVA-Qwen2.5-VL-7B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wanglne/EVA-Qwen2.5-VL-7B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="wanglne/EVA-Qwen2.5-VL-7B-Instruct") 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, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("wanglne/EVA-Qwen2.5-VL-7B-Instruct") model = AutoModelForMultimodalLM.from_pretrained("wanglne/EVA-Qwen2.5-VL-7B-Instruct", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use wanglne/EVA-Qwen2.5-VL-7B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wanglne/EVA-Qwen2.5-VL-7B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wanglne/EVA-Qwen2.5-VL-7B-Instruct", "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/wanglne/EVA-Qwen2.5-VL-7B-Instruct
- SGLang
How to use wanglne/EVA-Qwen2.5-VL-7B-Instruct 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 "wanglne/EVA-Qwen2.5-VL-7B-Instruct" \ --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": "wanglne/EVA-Qwen2.5-VL-7B-Instruct", "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 "wanglne/EVA-Qwen2.5-VL-7B-Instruct" \ --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": "wanglne/EVA-Qwen2.5-VL-7B-Instruct", "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 wanglne/EVA-Qwen2.5-VL-7B-Instruct with Docker Model Runner:
docker model run hf.co/wanglne/EVA-Qwen2.5-VL-7B-Instruct
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model:
|
| 4 |
+
- Qwen/Qwen2.5-VL-7B-Instruct
|
| 5 |
+
pipeline_tag: image-text-to-text
|
| 6 |
+
library_name: transformers
|
| 7 |
+
tags:
|
| 8 |
+
- EVA
|
| 9 |
+
- qwen2.5-vl
|
| 10 |
+
- model-editing
|
| 11 |
+
- ai-safety
|
| 12 |
+
- jailbreak
|
| 13 |
+
- defense
|
| 14 |
+
- vision-language-model
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# EVA-Qwen2.5-VL-7B-Instruct
|
| 18 |
+
|
| 19 |
+
This repository contains the final Qwen2.5-VL-7B-Instruct checkpoint produced by **EVA**.
|
| 20 |
+
|
| 21 |
+
EVA is an editing-based framework for improving the robustness and safety alignment of large language models and vision-language models against diverse jailbreak attacks while preserving their general capabilities on benign tasks.
|
| 22 |
+
|
| 23 |
+
## Model information
|
| 24 |
+
|
| 25 |
+
- **EVA checkpoint:** `wanglne/EVA-Qwen2.5-VL-7B-Instruct`
|
| 26 |
+
- **Base model:** [Qwen/Qwen2.5-VL-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct)
|
| 27 |
+
|
| 28 |
+
## Resources
|
| 29 |
+
|
| 30 |
+
- **Paper:** [EVA: Editing for Versatile Alignment against Jailbreaks](https://arxiv.org/abs/2605.14750)
|
| 31 |
+
- **IEEE TPAMI:** [10.1109/TPAMI.2026.3694189](https://doi.org/10.1109/TPAMI.2026.3694189)
|
| 32 |
+
- **Code:** [wanglne/EVA](https://github.com/wanglne/EVA)
|
| 33 |
+
- **EVA model collection:** [EVA models](https://huggingface.co/collections/wanglne/eva-editing-for-versatile-alignment-against-jailbreaks)
|
| 34 |
+
|
| 35 |
+
## Intended use
|
| 36 |
+
|
| 37 |
+
This checkpoint is released for research, reproduction, safety evaluation, and comparison with other alignment methods.
|
| 38 |
+
|
| 39 |
+
## License
|
| 40 |
+
|
| 41 |
+
This checkpoint is derived from Qwen2.5-VL-7B-Instruct. Its use and redistribution remain subject to the Apache License 2.0 and the applicable base-model terms.
|
| 42 |
+
|
| 43 |
+
The EVA source code is released separately under the MIT License.
|
| 44 |
+
|
| 45 |
+
## Citation
|
| 46 |
+
|
| 47 |
+
```bibtex
|
| 48 |
+
@ARTICLE{11523146,
|
| 49 |
+
author={Wang, Yi and Qiu, Hongye and Xu, Yue and Yang, Sibei and Qin, Zhan and Huang, Minlie and Wang, Wenjie},
|
| 50 |
+
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
|
| 51 |
+
title={EVA: Editing for Versatile Alignment against Jailbreaks},
|
| 52 |
+
year={2026},
|
| 53 |
+
volume={},
|
| 54 |
+
number={},
|
| 55 |
+
pages={1-16},
|
| 56 |
+
keywords={Automatic speech recognition;Modeling;Safety;Visualization;Large language models;Conferences;Optimization;Educational institutions;Light emitting diodes;Tuning;Safety Alignment;Jailbreak Attacks;Model Editing;Large Language Models;Vision Language Models},
|
| 57 |
+
doi={10.1109/TPAMI.2026.3694189}}
|
| 58 |
+
```
|