Views
No views yet
1uv venv
2source .venv/bin/activate
3
4# Install vLLM >=0.11.0
5uv pip install -U vllm
6
7# Install Qwen-VL utility library (recommended for offline inference)
8uv pip install qwen-vl-utils==0.0.14--enable-expert-parallel;
otherwise the expert tensors couldn’t be evenly sharded across GPU devices.CONTEXT_LENGTH=32768
vllm serve \
tclf90/Qwen3-VL-235B-A22B-Instruct-FP8 \
--served-model-name My_Model \
--enable-expert-parallel \
--swap-space 16 \
--max-num-seqs 64 \
--max-model-len $CONTEXT_LENGTH \
--gpu-memory-utilization 0.9 \
--tensor-parallel-size 8 \
--trust-remote-code \
--disable-log-requests \
--host 0.0.0.0 \
--port 80002025-09-27
1. initial commit| File Size | Last Updated |
|---|---|
222GB | 2025-09-27 |
1from modelscope import snapshot_download
2snapshot_download('tclf90/Qwen3-VL-235B-A22B-Instruct-FP8', cache_dir="your_local_path")


pip install git+https://github.com/huggingface/transformers
# pip install transformers==4.57.0 # currently, V4.57.0 is not releasedtransformers:1from transformers import Qwen3VLMoeForConditionalGeneration, AutoProcessor
2
3# default: Load the model on the available device(s)
4model = Qwen3VLMoeForConditionalGeneration.from_pretrained(
5 "Qwen/Qwen3-VL-235B-A22B-Instruct", dtype="auto", device_map="auto"
6)
7
8# We recommend enabling flash_attention_2 for better acceleration and memory saving, especially in multi-image and video scenarios.
9# model = Qwen3VLMoeForConditionalGeneration.from_pretrained(
10# "Qwen/Qwen3-VL-235B-A22B-Instruct",
11# dtype=torch.bfloat16,
12# attn_implementation="flash_attention_2",
13# device_map="auto",
14# )
15
16processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-235B-A22B-Instruct")
17
18messages = [
19 {
20 "role": "user",
21 "content": [
22 {
23 "type": "image",
24 "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
25 },
26 {"type": "text", "text": "Describe this image."},
27 ],
28 }
29]
30
31# Preparation for inference
32inputs = processor.apply_chat_template(
33 messages,
34 tokenize=True,
35 add_generation_prompt=True,
36 return_dict=True,
37 return_tensors="pt"
38)
39
40# Inference: Generation of the output
41generated_ids = model.generate(**inputs, max_new_tokens=128)
42generated_ids_trimmed = [
43 out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
44]
45output_text = processor.batch_decode(
46 generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
47)
48print(output_text)@misc{qwen2.5-VL,
title = {Qwen2.5-VL},
url = {https://qwenlm.github.io/blog/qwen2.5-vl/},
author = {Qwen Team},
month = {January},
year = {2025}
}
@article{Qwen2VL,
title={Qwen2-VL: Enhancing Vision-Language Model's Perception of the World at Any Resolution},
author={Wang, Peng and Bai, Shuai and Tan, Sinan and Wang, Shijie and Fan, Zhihao and Bai, Jinze and Chen, Keqin and Liu, Xuejing and Wang, Jialin and Ge, Wenbin and Fan, Yang and Dang, Kai and Du, Mengfei and Ren, Xuancheng and Men, Rui and Liu, Dayiheng and Zhou, Chang and Zhou, Jingren and Lin, Junyang},
journal={arXiv preprint arXiv:2409.12191},
year={2024}
}
@article{Qwen-VL,
title={Qwen-VL: A Versatile Vision-Language Model for Understanding, Localization, Text Reading, and Beyond},
author={Bai, Jinze and Bai, Shuai and Yang, Shusheng and Wang, Shijie and Tan, Sinan and Wang, Peng and Lin, Junyang and Zhou, Chang and Zhou, Jingren},
journal={arXiv preprint arXiv:2308.12966},
year={2023}
}