Instructions to use testdummyvt/Qwen2.5-VL-3B-Instruct-int8-dynamic-torchao with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use testdummyvt/Qwen2.5-VL-3B-Instruct-int8-dynamic-torchao with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="testdummyvt/Qwen2.5-VL-3B-Instruct-int8-dynamic-torchao") 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("testdummyvt/Qwen2.5-VL-3B-Instruct-int8-dynamic-torchao") model = AutoModelForMultimodalLM.from_pretrained("testdummyvt/Qwen2.5-VL-3B-Instruct-int8-dynamic-torchao", 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 testdummyvt/Qwen2.5-VL-3B-Instruct-int8-dynamic-torchao with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "testdummyvt/Qwen2.5-VL-3B-Instruct-int8-dynamic-torchao" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "testdummyvt/Qwen2.5-VL-3B-Instruct-int8-dynamic-torchao", "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/testdummyvt/Qwen2.5-VL-3B-Instruct-int8-dynamic-torchao
- SGLang
How to use testdummyvt/Qwen2.5-VL-3B-Instruct-int8-dynamic-torchao 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 "testdummyvt/Qwen2.5-VL-3B-Instruct-int8-dynamic-torchao" \ --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": "testdummyvt/Qwen2.5-VL-3B-Instruct-int8-dynamic-torchao", "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 "testdummyvt/Qwen2.5-VL-3B-Instruct-int8-dynamic-torchao" \ --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": "testdummyvt/Qwen2.5-VL-3B-Instruct-int8-dynamic-torchao", "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 testdummyvt/Qwen2.5-VL-3B-Instruct-int8-dynamic-torchao with Docker Model Runner:
docker model run hf.co/testdummyvt/Qwen2.5-VL-3B-Instruct-int8-dynamic-torchao
Upload Qwen2_5_VLForConditionalGeneration
Browse files- config.json +3 -45
- generation_config.json +1 -1
config.json
CHANGED
|
@@ -17,7 +17,6 @@
|
|
| 17 |
"num_hidden_layers": 36,
|
| 18 |
"num_key_value_heads": 2,
|
| 19 |
"quantization_config": {
|
| 20 |
-
"include_input_output_embeddings": false,
|
| 21 |
"modules_to_not_convert": null,
|
| 22 |
"quant_method": "torchao",
|
| 23 |
"quant_type": {
|
|
@@ -39,8 +38,7 @@
|
|
| 39 |
"_version": 1
|
| 40 |
}
|
| 41 |
},
|
| 42 |
-
"quant_type_kwargs": {}
|
| 43 |
-
"untie_embedding_weights": false
|
| 44 |
},
|
| 45 |
"rms_norm_eps": 1e-06,
|
| 46 |
"rope_scaling": {
|
|
@@ -54,48 +52,9 @@
|
|
| 54 |
},
|
| 55 |
"rope_theta": 1000000.0,
|
| 56 |
"sliding_window": 32768,
|
| 57 |
-
"
|
| 58 |
-
"architectures": [
|
| 59 |
-
"Qwen2_5_VLForConditionalGeneration"
|
| 60 |
-
],
|
| 61 |
-
"attention_dropout": 0.0,
|
| 62 |
-
"bos_token_id": 151643,
|
| 63 |
-
"eos_token_id": 151645,
|
| 64 |
-
"hidden_act": "silu",
|
| 65 |
-
"hidden_size": 2048,
|
| 66 |
-
"image_token_id": null,
|
| 67 |
-
"initializer_range": 0.02,
|
| 68 |
-
"intermediate_size": 11008,
|
| 69 |
-
"max_position_embeddings": 128000,
|
| 70 |
-
"max_window_layers": 70,
|
| 71 |
-
"model_type": "qwen2_5_vl_text",
|
| 72 |
-
"num_attention_heads": 16,
|
| 73 |
-
"num_hidden_layers": 36,
|
| 74 |
-
"num_key_value_heads": 2,
|
| 75 |
-
"rms_norm_eps": 1e-06,
|
| 76 |
-
"rope_scaling": {
|
| 77 |
-
"mrope_section": [
|
| 78 |
-
16,
|
| 79 |
-
24,
|
| 80 |
-
24
|
| 81 |
-
],
|
| 82 |
-
"rope_type": "default",
|
| 83 |
-
"type": "default"
|
| 84 |
-
},
|
| 85 |
-
"rope_theta": 1000000.0,
|
| 86 |
-
"sliding_window": 32768,
|
| 87 |
-
"tie_word_embeddings": true,
|
| 88 |
-
"torch_dtype": "bfloat16",
|
| 89 |
-
"use_cache": true,
|
| 90 |
-
"use_sliding_window": false,
|
| 91 |
-
"video_token_id": null,
|
| 92 |
-
"vision_end_token_id": 151653,
|
| 93 |
-
"vision_start_token_id": 151652,
|
| 94 |
-
"vision_token_id": 151654,
|
| 95 |
-
"vocab_size": 151936
|
| 96 |
-
},
|
| 97 |
"torch_dtype": "bfloat16",
|
| 98 |
-
"transformers_version": "4.
|
| 99 |
"use_cache": true,
|
| 100 |
"use_sliding_window": false,
|
| 101 |
"video_token_id": 151656,
|
|
@@ -111,7 +70,6 @@
|
|
| 111 |
"hidden_size": 1280,
|
| 112 |
"in_channels": 3,
|
| 113 |
"in_chans": 3,
|
| 114 |
-
"initializer_range": 0.02,
|
| 115 |
"intermediate_size": 3420,
|
| 116 |
"model_type": "qwen2_5_vl",
|
| 117 |
"num_heads": 16,
|
|
|
|
| 17 |
"num_hidden_layers": 36,
|
| 18 |
"num_key_value_heads": 2,
|
| 19 |
"quantization_config": {
|
|
|
|
| 20 |
"modules_to_not_convert": null,
|
| 21 |
"quant_method": "torchao",
|
| 22 |
"quant_type": {
|
|
|
|
| 38 |
"_version": 1
|
| 39 |
}
|
| 40 |
},
|
| 41 |
+
"quant_type_kwargs": {}
|
|
|
|
| 42 |
},
|
| 43 |
"rms_norm_eps": 1e-06,
|
| 44 |
"rope_scaling": {
|
|
|
|
| 52 |
},
|
| 53 |
"rope_theta": 1000000.0,
|
| 54 |
"sliding_window": 32768,
|
| 55 |
+
"tie_word_embeddings": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
"torch_dtype": "bfloat16",
|
| 57 |
+
"transformers_version": "4.51.3",
|
| 58 |
"use_cache": true,
|
| 59 |
"use_sliding_window": false,
|
| 60 |
"video_token_id": 151656,
|
|
|
|
| 70 |
"hidden_size": 1280,
|
| 71 |
"in_channels": 3,
|
| 72 |
"in_chans": 3,
|
|
|
|
| 73 |
"intermediate_size": 3420,
|
| 74 |
"model_type": "qwen2_5_vl",
|
| 75 |
"num_heads": 16,
|
generation_config.json
CHANGED
|
@@ -8,5 +8,5 @@
|
|
| 8 |
"pad_token_id": 151643,
|
| 9 |
"repetition_penalty": 1.05,
|
| 10 |
"temperature": 1e-06,
|
| 11 |
-
"transformers_version": "4.
|
| 12 |
}
|
|
|
|
| 8 |
"pad_token_id": 151643,
|
| 9 |
"repetition_penalty": 1.05,
|
| 10 |
"temperature": 1e-06,
|
| 11 |
+
"transformers_version": "4.51.3"
|
| 12 |
}
|