Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,69 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- vllm
|
| 4 |
+
- vision
|
| 5 |
+
- fp8
|
| 6 |
+
license: apache-2.0
|
| 7 |
+
license_link: >-
|
| 8 |
+
https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/apache-2.0.md
|
| 9 |
+
language:
|
| 10 |
+
- en
|
| 11 |
+
base_model: Qwen/Qwen2.5-VL-72B-Instruct
|
| 12 |
+
library_name: transformers
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# Qwen2.5-VL-32B-Instruct-FP8-Dynamic
|
| 16 |
+
|
| 17 |
+
## Model Overview
|
| 18 |
+
- **Model Architecture:** Qwen2.5-VL-72B-Instruct
|
| 19 |
+
- **Input:** Vision-Text
|
| 20 |
+
- **Output:** Text
|
| 21 |
+
- **Model Optimizations:**
|
| 22 |
+
- **Weight quantization:** FP8
|
| 23 |
+
- **Activation quantization:** FP8
|
| 24 |
+
- **Release Date:** 2/24/2025
|
| 25 |
+
- **Version:** 1.0
|
| 26 |
+
- **Model Developers:** Neural Magic
|
| 27 |
+
|
| 28 |
+
Quantized version of [Qwen/Qwen2.5-VL-32B-Instruct](https://huggingface.co/Qwen/Qwen2.5-VL-32B-Instruct).
|
| 29 |
+
|
| 30 |
+
### Model Optimizations
|
| 31 |
+
|
| 32 |
+
This model was obtained by quantizing the weights of [Qwen/Qwen2.5-VL-32B-Instruct](https://huggingface.co/Qwen/Qwen2.5-VL-32B-Instruct) to FP8 data type, ready for inference with vLLM >= 0.5.2.
|
| 33 |
+
|
| 34 |
+
## Deployment
|
| 35 |
+
|
| 36 |
+
### Use with vLLM
|
| 37 |
+
|
| 38 |
+
This model can be deployed efficiently using the [vLLM](https://docs.vllm.ai/en/latest/) backend, as shown in the example below.
|
| 39 |
+
|
| 40 |
+
```python
|
| 41 |
+
from vllm.assets.image import ImageAsset
|
| 42 |
+
from vllm import LLM, SamplingParams
|
| 43 |
+
|
| 44 |
+
# prepare model
|
| 45 |
+
llm = LLM(
|
| 46 |
+
model="neuralmagic/Qwen2.5-VL-72B-Instruct-FP8-Dynamic",
|
| 47 |
+
trust_remote_code=True,
|
| 48 |
+
max_model_len=4096,
|
| 49 |
+
max_num_seqs=2,
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
# prepare inputs
|
| 53 |
+
question = "What is the content of this image?"
|
| 54 |
+
inputs = {
|
| 55 |
+
"prompt": f"<|user|>\n<|image_1|>\n{question}<|end|>\n<|assistant|>\n",
|
| 56 |
+
"multi_modal_data": {
|
| 57 |
+
"image": ImageAsset("cherry_blossom").pil_image.convert("RGB")
|
| 58 |
+
},
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
# generate response
|
| 62 |
+
print("========== SAMPLE GENERATION ==============")
|
| 63 |
+
outputs = llm.generate(inputs, SamplingParams(temperature=0.2, max_tokens=64))
|
| 64 |
+
print(f"PROMPT : {outputs[0].prompt}")
|
| 65 |
+
print(f"RESPONSE: {outputs[0].outputs[0].text}")
|
| 66 |
+
print("==========================================")
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
vLLM also supports OpenAI-compatible serving. See the [documentation](https://docs.vllm.ai/en/latest/) for more details.
|