Instructions to use Qwen/Qwen-VL-Chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Qwen/Qwen-VL-Chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Qwen/Qwen-VL-Chat", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen-VL-Chat", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Qwen/Qwen-VL-Chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qwen/Qwen-VL-Chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Qwen/Qwen-VL-Chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Qwen/Qwen-VL-Chat
- SGLang
How to use Qwen/Qwen-VL-Chat 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/Qwen-VL-Chat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Qwen/Qwen-VL-Chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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/Qwen-VL-Chat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Qwen/Qwen-VL-Chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Qwen/Qwen-VL-Chat with Docker Model Runner:
docker model run hf.co/Qwen/Qwen-VL-Chat
Commit History
Support chat-stream 6665c78
Support chat_stream 989c61a
support chat_stream ae4b906
Update tokenization_qwen.py 37124e2
Update visual.py 88d6dd3
shuai bai commited on
Update modeling_qwen.py 0b3eb69
shuai bai commited on
Update modeling_qwen.py 5bdb809
shuai bai commited on
Update modeling_qwen.py bbe5a80
shuai bai commited on
Update modeling_qwen.py e718765
shuai bai commited on
Upload pytorch_model-00010-of-00010.bin with huggingface_hub 2562bb2
Upload pytorch_model-00009-of-00010.bin with huggingface_hub 4dc08b7
Upload pytorch_model-00008-of-00010.bin with huggingface_hub 8c39601
Upload pytorch_model-00007-of-00010.bin with huggingface_hub de6203b
Upload pytorch_model-00006-of-00010.bin with huggingface_hub 7cf6683
Upload pytorch_model-00005-of-00010.bin with huggingface_hub 3a68639
Upload pytorch_model-00004-of-00010.bin with huggingface_hub 678f336
Upload pytorch_model-00003-of-00010.bin with huggingface_hub 09d6bcf
Upload pytorch_model-00002-of-00010.bin with huggingface_hub 4ba7f26
Upload pytorch_model-00001-of-00010.bin with huggingface_hub 6657a5f
Update README.md 0eecbfa
shuai bai commited on
Update tokenization_qwen.py 96a960a
Upload README.md 313f3a0
Update tokenization_qwen.py 7595aae
Update modeling_qwen.py 0288b7e
Update modeling_qwen.py a3d284e
shuai bai commited on
Update tokenization_qwen.py 1fb8c15
Update tokenization_qwen.py 2d34a29
Update tokenization_qwen.py ef917c8
lower top p 548275c
shuai bai commited on