Instructions to use Qwen/Qwen2-VL-72B-Instruct-AWQ 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-AWQ 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-AWQ" # 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-AWQ", "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-AWQ
- SGLang
How to use Qwen/Qwen2-VL-72B-Instruct-AWQ 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-AWQ" \ --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-AWQ", "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-AWQ" \ --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-AWQ", "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-AWQ with Docker Model Runner:
docker model run hf.co/Qwen/Qwen2-VL-72B-Instruct-AWQ
Error When trying to load the model with text-generation-inference
When trying to load this model using hugging face text-generation-inference docker image v1.4.2, I get the following error.
my parameters for TGI look like this
model_id: "Qwen/Qwen2-VL-72B-Instruct-AWQ"
num_shard: 1
cuda_memory_fraction: 1
max_top_n_tokens: 30
enable_cuda_graphs: true
cuda_visible_devices: 1
hf_token: ''
rope_scaling: 'dynamic'
rope_factor: 1
quantization: 'awq'
โ 370 โ โ """ โ
โ โฑ 371 โ โ return self.weights_loader.get_weights_col_packed(self, prefix โ
โ 372 โ โ
โ 373 โ def get_weights_col(self, prefix: str): โ
โ 374 โ โ return self.weights_loader.get_weights_col(self, prefix) โ
โ โ
โ โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ locals โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ
โ โ block_sizes = [16, 16, 16] โ โ
โ โ prefix = 'visual.blocks.0.attn.qkv' โ โ
โ โ self = <text_generation_server.utils.weights.Weights object at โ โ
โ โ 0x7f8c7d7b4590> โ โ
โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ โ
โ โ
โ /opt/conda/lib/python3.11/site-packages/text_generation_server/layers/marlin โ
โ /gptq.py:117 in get_weights_col_packed โ
โ โ
โ 114 โ โ โ โ f"{prefix}.qweight", dim=1, block_sizes=block_sizes โ
โ 115 โ โ โ ) โ
โ 116 โ โ except RuntimeError: โ
โ โฑ 117 โ โ โ raise RuntimeError( โ
โ 118 โ โ โ โ f"Cannot load {self.quantize} weight, make sure the โ
โ 119 โ โ โ ) โ
โ 120 โ โ scales = weights.get_packed_sharded( โ
โ โ
โ โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ locals โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ
โ โ block_sizes = [16, 16, 16] โ โ
โ โ prefix = 'visual.blocks.0.attn.qkv' โ โ
โ โ self = <text_generation_server.layers.marlin.gptq.GPTQMarlinWeigโฆ โ โ
โ โ object at 0x7f8c7d9238d0> โ โ
โ โ weights = <text_generation_server.utils.weights.Weights object at โ โ
โ โ 0x7f8c7d7b4590> โ โ
โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
RuntimeError: Cannot load awq weight, make sure the model is already
quantized. rank=0
2024-12-02T20:51:14.220341Z ERROR text_generation_launcher: Shard 0 failed to start
I get the same issue for the huggingface inference API for this model