WaveCut/LingBot-Video-Dense-1.3B-SDNQ-uint4-static
016
1---2license: apache-2.03pipeline_tag: image-text-to-text4---5<a href="https://chat.qwenlm.ai/" target="_blank" style="margin: 2px;">6 <img alt="Chat" src="https://img.shields.io/badge/%F0%9F%92%9C%EF%B8%8F%20Qwen%20Chat%20-536af5" style="display: inline-block; vertical-align: middle;"/>7</a>8 9 10# Qwen3-VL-4B-Instruct11 12 13Meet Qwen3-VL — the most powerful vision-language model in the Qwen series to date.14 15This generation delivers comprehensive upgrades across the board: superior text understanding & generation, deeper visual perception & reasoning, extended context length, enhanced spatial and video dynamics comprehension, and stronger agent interaction capabilities.16 17Available in Dense and MoE architectures that scale from edge to cloud, with Instruct and reasoning‑enhanced Thinking editions for flexible, on‑demand deployment.18 19 20#### Key Enhancements:21 22* **Visual Agent**: Operates PC/mobile GUIs—recognizes elements, understands functions, invokes tools, completes tasks.23 24* **Visual Coding Boost**: Generates Draw.io/HTML/CSS/JS from images/videos.25 26* **Advanced Spatial Perception**: Judges object positions, viewpoints, and occlusions; provides stronger 2D grounding and enables 3D grounding for spatial reasoning and embodied AI.27 28* **Long Context & Video Understanding**: Native 256K context, expandable to 1M; handles books and hours-long video with full recall and second-level indexing.29 30* **Enhanced Multimodal Reasoning**: Excels in STEM/Math—causal analysis and logical, evidence-based answers.31 32* **Upgraded Visual Recognition**: Broader, higher-quality pretraining is able to “recognize everything”—celebrities, anime, products, landmarks, flora/fauna, etc.33 34* **Expanded OCR**: Supports 32 languages (up from 19); robust in low light, blur, and tilt; better with rare/ancient characters and jargon; improved long-document structure parsing.35 36* **Text Understanding on par with pure LLMs**: Seamless text–vision fusion for lossless, unified comprehension.37 38 39#### Model Architecture Updates:40 41<p align="center">42 <img src="https://qianwen-res.oss-accelerate.aliyuncs.com/Qwen3-VL/qwen3vl_arc.jpg" width="80%"/>43<p>44 45 461. **Interleaved-MRoPE**: Full‑frequency allocation over time, width, and height via robust positional embeddings, enhancing long‑horizon video reasoning.47 482. **DeepStack**: Fuses multi‑level ViT features to capture fine‑grained details and sharpen image–text alignment.49 503. **Text–Timestamp Alignment:** Moves beyond T‑RoPE to precise, timestamp‑grounded event localization for stronger video temporal modeling.51 52This is the weight repository for Qwen3-VL-4B-Instruct.53 54 55---56 57## Model Performance58 59**Multimodal performance**60 6162 63**Pure text performance**6465 66## Quickstart67 68Below, we provide simple examples to show how to use Qwen3-VL with 🤖 ModelScope and 🤗 Transformers.69 70The code of Qwen3-VL has been in the latest Hugging Face transformers and we advise you to build from source with command:71```72pip install git+https://github.com/huggingface/transformers73# pip install transformers==4.57.0 # currently, V4.57.0 is not released74```75 76### Using 🤗 Transformers to Chat77 78Here we show a code snippet to show how to use the chat model with `transformers`:79 80```python81from transformers import Qwen3VLForConditionalGeneration, AutoProcessor82 83# default: Load the model on the available device(s)84model = Qwen3VLForConditionalGeneration.from_pretrained(85 "Qwen/Qwen3-VL-4B-Instruct", dtype="auto", device_map="auto"86)87 88# We recommend enabling flash_attention_2 for better acceleration and memory saving, especially in multi-image and video scenarios.89# model = Qwen3VLForConditionalGeneration.from_pretrained(90# "Qwen/Qwen3-VL-4B-Instruct",91# dtype=torch.bfloat16,92# attn_implementation="flash_attention_2",93# device_map="auto",94# )95 96processor = AutoProcessor.from_pretrained("Qwen/Qwen/Qwen3-VL-4B-Instruct")97 98messages = [99 {100 "role": "user",101 "content": [102 {103 "type": "image",104 "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",105 },106 {"type": "text", "text": "Describe this image."},107 ],108 }109]110 111# Preparation for inference112inputs = processor.apply_chat_template(113 messages,114 tokenize=True,115 add_generation_prompt=True,116 return_dict=True,117 return_tensors="pt"118)119 120# Inference: Generation of the output121generated_ids = model.generate(**inputs, max_new_tokens=128)122generated_ids_trimmed = [123 out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)124]125output_text = processor.batch_decode(126 generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False127)128print(output_text)129```130 131### Generation Hyperparameters132#### VL133```bash134export greedy='false'135export top_p=0.8136export top_k=20137export temperature=0.7138export repetition_penalty=1.0139export presence_penalty=1.5140export out_seq_length=16384141```142 143#### Text144```bash145export greedy='false'146export top_p=1.0147export top_k=40148export repetition_penalty=1.0149export presence_penalty=2.0150export temperature=1.0151export out_seq_length=32768152```153 154 155## Citation156 157If you find our work helpful, feel free to give us a cite.158 159```160@misc{qwen3technicalreport,161 title={Qwen3 Technical Report}, 162 author={Qwen Team},163 year={2025},164 eprint={2505.09388},165 archivePrefix={arXiv},166 primaryClass={cs.CL},167 url={https://arxiv.org/abs/2505.09388}, 168}169 170@article{Qwen2.5-VL,171 title={Qwen2.5-VL Technical Report},172 author={Bai, Shuai and Chen, Keqin and Liu, Xuejing and Wang, Jialin and Ge, Wenbin and Song, Sibo and Dang, Kai and Wang, Peng and Wang, Shijie and Tang, Jun and Zhong, Humen and Zhu, Yuanzhi and Yang, Mingkun and Li, Zhaohai and Wan, Jianqiang and Wang, Pengfei and Ding, Wei and Fu, Zheren and Xu, Yiheng and Ye, Jiabo and Zhang, Xi and Xie, Tianbao and Cheng, Zesen and Zhang, Hang and Yang, Zhibo and Xu, Haiyang and Lin, Junyang},173 journal={arXiv preprint arXiv:2502.13923},174 year={2025}175}176 177@article{Qwen2VL,178 title={Qwen2-VL: Enhancing Vision-Language Model's Perception of the World at Any Resolution},179 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},180 journal={arXiv preprint arXiv:2409.12191},181 year={2024}182}183 184@article{Qwen-VL,185 title={Qwen-VL: A Versatile Vision-Language Model for Understanding, Localization, Text Reading, and Beyond},186 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},187 journal={arXiv preprint arXiv:2308.12966},188 year={2023}189}190```