Image-Text-to-Text
Transformers
Safetensors
English
qwen2_5_vl
vllm
vision
fp8
conversational
text-generation-inference
compressed-tensors
Instructions to use RedHatAI/Qwen2.5-VL-7B-Instruct-FP8-Dynamic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RedHatAI/Qwen2.5-VL-7B-Instruct-FP8-Dynamic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="RedHatAI/Qwen2.5-VL-7B-Instruct-FP8-Dynamic") 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("RedHatAI/Qwen2.5-VL-7B-Instruct-FP8-Dynamic") model = AutoModelForImageTextToText.from_pretrained("RedHatAI/Qwen2.5-VL-7B-Instruct-FP8-Dynamic") 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 RedHatAI/Qwen2.5-VL-7B-Instruct-FP8-Dynamic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RedHatAI/Qwen2.5-VL-7B-Instruct-FP8-Dynamic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RedHatAI/Qwen2.5-VL-7B-Instruct-FP8-Dynamic", "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/RedHatAI/Qwen2.5-VL-7B-Instruct-FP8-Dynamic
- SGLang
How to use RedHatAI/Qwen2.5-VL-7B-Instruct-FP8-Dynamic 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 "RedHatAI/Qwen2.5-VL-7B-Instruct-FP8-Dynamic" \ --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": "RedHatAI/Qwen2.5-VL-7B-Instruct-FP8-Dynamic", "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 "RedHatAI/Qwen2.5-VL-7B-Instruct-FP8-Dynamic" \ --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": "RedHatAI/Qwen2.5-VL-7B-Instruct-FP8-Dynamic", "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 RedHatAI/Qwen2.5-VL-7B-Instruct-FP8-Dynamic with Docker Model Runner:
docker model run hf.co/RedHatAI/Qwen2.5-VL-7B-Instruct-FP8-Dynamic
Update README.md
Browse files
README.md
CHANGED
|
@@ -277,6 +277,37 @@ The following performance benchmarks were conducted with [vLLM](https://docs.vll
|
|
| 277 |
</tr>
|
| 278 |
</thead>
|
| 279 |
<tbody style="text-align: center">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 280 |
<tr>
|
| 281 |
<th rowspan="3" valign="top">A100x1</th>
|
| 282 |
<th>Qwen/Qwen2.5-VL-7B-Instruct</th>
|
|
@@ -371,9 +402,40 @@ The following performance benchmarks were conducted with [vLLM](https://docs.vll
|
|
| 371 |
</tr>
|
| 372 |
</thead>
|
| 373 |
<tbody style="text-align: center">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 374 |
<tr>
|
| 375 |
<th rowspan="3" valign="top">A100x1</th>
|
| 376 |
-
<th>Qwen/Qwen2.5-VL-7B-Instruct
|
| 377 |
<td></td>
|
| 378 |
<td>0.7</td>
|
| 379 |
<td>1347</td>
|
|
|
|
| 277 |
</tr>
|
| 278 |
</thead>
|
| 279 |
<tbody style="text-align: center">
|
| 280 |
+
<tr>
|
| 281 |
+
<th rowspan="3" valign="top">A6000x1</th>
|
| 282 |
+
<th>Qwen/Qwen2.5-VL-7B-Instruct</th>
|
| 283 |
+
<td></td>
|
| 284 |
+
<td>4.9</td>
|
| 285 |
+
<td>912</td>
|
| 286 |
+
<td>3.2</td>
|
| 287 |
+
<td>1386</td>
|
| 288 |
+
<td>3.1</td>
|
| 289 |
+
<td>1431</td>
|
| 290 |
+
</tr>
|
| 291 |
+
<tr>
|
| 292 |
+
<th>neuralmagic/Qwen2.5-VL-7B-Instruct-quantized.w8a8</th>
|
| 293 |
+
<td>1.50</td>
|
| 294 |
+
<td>3.6</td>
|
| 295 |
+
<td>1248</td>
|
| 296 |
+
<td>2.1</td>
|
| 297 |
+
<td>2163</td>
|
| 298 |
+
<td>2.0</td>
|
| 299 |
+
<td>2237</td>
|
| 300 |
+
</tr>
|
| 301 |
+
<tr>
|
| 302 |
+
<th>neuralmagic/Qwen2.5-VL-7B-Instruct-quantized.w4a16</th>
|
| 303 |
+
<td>2.05</td>
|
| 304 |
+
<td>3.3</td>
|
| 305 |
+
<td>1351</td>
|
| 306 |
+
<td>1.4</td>
|
| 307 |
+
<td>3252</td>
|
| 308 |
+
<td>1.4</td>
|
| 309 |
+
<td>3321</td>
|
| 310 |
+
</tr>
|
| 311 |
<tr>
|
| 312 |
<th rowspan="3" valign="top">A100x1</th>
|
| 313 |
<th>Qwen/Qwen2.5-VL-7B-Instruct</th>
|
|
|
|
| 402 |
</tr>
|
| 403 |
</thead>
|
| 404 |
<tbody style="text-align: center">
|
| 405 |
+
<tr>
|
| 406 |
+
<th rowspan="3" valign="top">A6000x1</th>
|
| 407 |
+
<th>Qwen/Qwen2.5-VL-7B-Instruct</th>
|
| 408 |
+
<td></td>
|
| 409 |
+
<td>0.4</td>
|
| 410 |
+
<td>1837</td>
|
| 411 |
+
<td>1.5</td>
|
| 412 |
+
<td>6846</td>
|
| 413 |
+
<td>1.7</td>
|
| 414 |
+
<td>7638</td>
|
| 415 |
+
</tr>
|
| 416 |
+
<tr>
|
| 417 |
+
<th>neuralmagic/Qwen2.5-VL-7B-Instruct-quantized.w8a8</th>
|
| 418 |
+
<td>1.41</td>
|
| 419 |
+
<td>0.5</td>
|
| 420 |
+
<td>2297</td>
|
| 421 |
+
<td>2.3</td>
|
| 422 |
+
<td>10137</td>
|
| 423 |
+
<td>2.5</td>
|
| 424 |
+
<td>11472</td>
|
| 425 |
+
</tr>
|
| 426 |
+
<tr>
|
| 427 |
+
<th>neuralmagic/Qwen2.5-VL-7B-Instruct-quantized.w4a16</th>
|
| 428 |
+
<td>1.60</td>
|
| 429 |
+
<td>0.4</td>
|
| 430 |
+
<td>1828</td>
|
| 431 |
+
<td>2.7</td>
|
| 432 |
+
<td>12254</td>
|
| 433 |
+
<td>3.4</td>
|
| 434 |
+
<td>15477</td>
|
| 435 |
+
</tr>
|
| 436 |
<tr>
|
| 437 |
<th rowspan="3" valign="top">A100x1</th>
|
| 438 |
+
<th>Qwen/Qwen2.5-VL-7B-Instruct</th>
|
| 439 |
<td></td>
|
| 440 |
<td>0.7</td>
|
| 441 |
<td>1347</td>
|