vllm.model_executor.models.qwen_vl ¶
Inference-only Qwen-VL model compatible with HuggingFace weights.
QwenImageEmbeddingInputs ¶
Bases: TensorSchema
Dimensions
- bn: Batch size * number of images
- ifs: Image feature size (256)
- hs: Hidden size
hidden_size must match the hidden size of the language model backbone and is stored in the visual config of the model if we have one.
Source code in vllm/model_executor/models/qwen_vl.py
QwenImagePixelInputs ¶
Bases: TensorSchema
Dimensions
- bn: Batch size * number of images
- c: Number of channels (3)
- h: Height
- w: Width
Note that image_size is the value in the vision config to which we resize the image to in the normalization transform. Currently multi-image support can only be leveraged by passing image embeddings directly.
Source code in vllm/model_executor/models/qwen_vl.py
QwenVLForConditionalGeneration ¶
Bases: QWenBaseModel, SupportsPP, SupportsLoRA, SupportsMultiModal
Source code in vllm/model_executor/models/qwen_vl.py
656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 | |
get_mm_mapping ¶
Get the module prefix in multimodal models
Source code in vllm/model_executor/models/qwen_vl.py
QwenVLMLP ¶
Bases: Module
MLP for the visual component of the Qwen model.
Source code in vllm/model_executor/models/qwen_vl.py
QwenVLProcessor ¶
This model doesn't define its own HF processor, so we implement our own one here.
We call the wrapped tokenizer to automatically insert image pad tokens: https://huggingface.co/Qwen/Qwen-VL/blob/main/tokenization_qwen.py#L245
The image processor is defined here: https://huggingface.co/Qwen/Qwen-VL/blob/main/visual.py#L354
Source code in vllm/model_executor/models/qwen_vl.py
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 | |
VisualAttention ¶
Bases: Module
self-attention layer class. Self-attention layer takes input with size [s, b, h] and returns output of the same size.
Source code in vllm/model_executor/models/qwen_vl.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | |