Instructions to use Qwen/Qwen2-VL-72B-Instruct-GPTQ-Int4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- vLLM
How to use Qwen/Qwen2-VL-72B-Instruct-GPTQ-Int4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qwen/Qwen2-VL-72B-Instruct-GPTQ-Int4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Qwen/Qwen2-VL-72B-Instruct-GPTQ-Int4", "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/Qwen/Qwen2-VL-72B-Instruct-GPTQ-Int4
- SGLang
How to use Qwen/Qwen2-VL-72B-Instruct-GPTQ-Int4 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 "Qwen/Qwen2-VL-72B-Instruct-GPTQ-Int4" \ --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": "Qwen/Qwen2-VL-72B-Instruct-GPTQ-Int4", "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 "Qwen/Qwen2-VL-72B-Instruct-GPTQ-Int4" \ --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": "Qwen/Qwen2-VL-72B-Instruct-GPTQ-Int4", "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 Qwen/Qwen2-VL-72B-Instruct-GPTQ-Int4 with Docker Model Runner:
docker model run hf.co/Qwen/Qwen2-VL-72B-Instruct-GPTQ-Int4
可亲 commited on
Commit ·
288c348
1
Parent(s): 669a942
fix(pad zero) pad intermediate_size to 29696 to make sure quantized model can use 8 tensor-parallel in vllm
Browse files- config.json +10 -16
- model-00002-of-00011.safetensors +2 -2
- model-00003-of-00011.safetensors +2 -2
- model-00004-of-00011.safetensors +2 -2
- model-00005-of-00011.safetensors +2 -2
- model-00006-of-00011.safetensors +2 -2
- model-00007-of-00011.safetensors +2 -2
- model-00008-of-00011.safetensors +2 -2
- model-00009-of-00011.safetensors +2 -2
- model-00010-of-00011.safetensors +2 -2
- model-00011-of-00011.safetensors +2 -2
- model.safetensors.index.json +1 -1
config.json
CHANGED
|
@@ -1,20 +1,16 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "Qwen/Qwen2-VL-72B-Instruct-
|
| 3 |
"architectures": [
|
| 4 |
"Qwen2VLForConditionalGeneration"
|
| 5 |
],
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"bos_token_id": 151643,
|
| 8 |
"eos_token_id": 151645,
|
| 9 |
-
"vision_start_token_id": 151652,
|
| 10 |
-
"vision_end_token_id": 151653,
|
| 11 |
-
"vision_token_id": 151654,
|
| 12 |
-
"image_token_id": 151655,
|
| 13 |
-
"video_token_id": 151656,
|
| 14 |
"hidden_act": "silu",
|
| 15 |
"hidden_size": 8192,
|
|
|
|
| 16 |
"initializer_range": 0.02,
|
| 17 |
-
"intermediate_size":
|
| 18 |
"max_position_embeddings": 32768,
|
| 19 |
"max_window_layers": 80,
|
| 20 |
"model_type": "qwen2_vl",
|
|
@@ -48,17 +44,15 @@
|
|
| 48 |
"transformers_version": "4.45.0.dev0",
|
| 49 |
"use_cache": true,
|
| 50 |
"use_sliding_window": false,
|
|
|
|
| 51 |
"vision_config": {
|
| 52 |
-
"depth": 32,
|
| 53 |
-
"embed_dim": 1280,
|
| 54 |
-
"mlp_ratio": 4,
|
| 55 |
-
"num_heads": 16,
|
| 56 |
-
"in_chans": 3,
|
| 57 |
"hidden_size": 8192,
|
| 58 |
-
"
|
| 59 |
-
"
|
| 60 |
-
"spatial_patch_size": 14
|
| 61 |
-
"temporal_patch_size": 2
|
| 62 |
},
|
|
|
|
|
|
|
|
|
|
| 63 |
"vocab_size": 152064
|
| 64 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "Qwen/Qwen2-VL-72B-Instruct-315-fix-dim-pad",
|
| 3 |
"architectures": [
|
| 4 |
"Qwen2VLForConditionalGeneration"
|
| 5 |
],
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"bos_token_id": 151643,
|
| 8 |
"eos_token_id": 151645,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
"hidden_act": "silu",
|
| 10 |
"hidden_size": 8192,
|
| 11 |
+
"image_token_id": 151655,
|
| 12 |
"initializer_range": 0.02,
|
| 13 |
+
"intermediate_size": 29696,
|
| 14 |
"max_position_embeddings": 32768,
|
| 15 |
"max_window_layers": 80,
|
| 16 |
"model_type": "qwen2_vl",
|
|
|
|
| 44 |
"transformers_version": "4.45.0.dev0",
|
| 45 |
"use_cache": true,
|
| 46 |
"use_sliding_window": false,
|
| 47 |
+
"video_token_id": 151656,
|
| 48 |
"vision_config": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
"hidden_size": 8192,
|
| 50 |
+
"in_chans": 3,
|
| 51 |
+
"model_type": "qwen2_vl",
|
| 52 |
+
"spatial_patch_size": 14
|
|
|
|
| 53 |
},
|
| 54 |
+
"vision_end_token_id": 151653,
|
| 55 |
+
"vision_start_token_id": 151652,
|
| 56 |
+
"vision_token_id": 151654,
|
| 57 |
"vocab_size": 152064
|
| 58 |
}
|
model-00002-of-00011.safetensors
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:45d3b76058c8eff6d2ebf879f82ceff8fabefcb369bbc674b47ef9e51e634184
|
| 3 |
+
size 3916744448
|
model-00003-of-00011.safetensors
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:ccb329fd14b0ca16bc1b14a58e8a859fa3a6f2905a03388be9b92bc955346c2a
|
| 3 |
+
size 3995377968
|
model-00004-of-00011.safetensors
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:d8d6e3c26d69b39cbde61744bf0b60adf1fe07e751ded341924c6ce6f6ad9869
|
| 3 |
+
size 3995292000
|
model-00005-of-00011.safetensors
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:ae941c3aae7310f6447f00162fb2a5dc3eef83446e8f6d394ec99e7e53b91f08
|
| 3 |
+
size 3916744720
|
model-00006-of-00011.safetensors
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:a38f2e3f7dd0c6e4b02b25bd7353cd092fd099e4860419305d82cec3b8e3a744
|
| 3 |
+
size 3995378008
|
model-00007-of-00011.safetensors
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:00704e00f9deef3aad2d0a5703b2ee94c3bc0456bc597c2b12c97450cbc21354
|
| 3 |
+
size 3995292000
|
model-00008-of-00011.safetensors
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:086663beec63d0cdd63cf43839e4e84ec7d3903bc39ca100590094eb3fff9596
|
| 3 |
+
size 3916744720
|
model-00009-of-00011.safetensors
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:c5a23a028d90c731b76d1710140512cef54ba2fc2a0559382ac59ec6af727750
|
| 3 |
+
size 3995378008
|
model-00010-of-00011.safetensors
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:9ce98548c5ad9c0d1bd960d601d2edbbb994610d1049622762f98bab672c95c2
|
| 3 |
+
size 3995292000
|
model-00011-of-00011.safetensors
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:c4b6514d5795ed72e8921df2af722ab7f06b9825a7f2e187e8cb4b44d4f6e35b
|
| 3 |
+
size 3328787792
|
model.safetensors.index.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"metadata": {
|
| 3 |
-
"total_size":
|
| 4 |
},
|
| 5 |
"weight_map": {
|
| 6 |
"lm_head.weight": "model-00011-of-00011.safetensors",
|
|
|
|
| 1 |
{
|
| 2 |
"metadata": {
|
| 3 |
+
"total_size": 43019463680
|
| 4 |
},
|
| 5 |
"weight_map": {
|
| 6 |
"lm_head.weight": "model-00011-of-00011.safetensors",
|