Instructions to use deepseek-ai/deepseek-vl2-tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use deepseek-ai/deepseek-vl2-tiny with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="deepseek-ai/deepseek-vl2-tiny")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("deepseek-ai/deepseek-vl2-tiny", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use deepseek-ai/deepseek-vl2-tiny with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "deepseek-ai/deepseek-vl2-tiny" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deepseek-ai/deepseek-vl2-tiny", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/deepseek-ai/deepseek-vl2-tiny
- SGLang
How to use deepseek-ai/deepseek-vl2-tiny 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 "deepseek-ai/deepseek-vl2-tiny" \ --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": "deepseek-ai/deepseek-vl2-tiny", "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 "deepseek-ai/deepseek-vl2-tiny" \ --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": "deepseek-ai/deepseek-vl2-tiny", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use deepseek-ai/deepseek-vl2-tiny with Docker Model Runner:
docker model run hf.co/deepseek-ai/deepseek-vl2-tiny
Update README.md
Browse files
README.md
CHANGED
|
@@ -37,6 +37,11 @@ On the basis of `Python >= 3.8` environment, install the necessary dependencies
|
|
| 37 |
pip install -e .
|
| 38 |
```
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
### Simple Inference Example
|
| 41 |
|
| 42 |
```python
|
|
@@ -121,10 +126,14 @@ This code repository is licensed under [MIT License](./LICENSE-CODE). The use of
|
|
| 121 |
## 5. Citation
|
| 122 |
|
| 123 |
```
|
| 124 |
-
@misc{
|
| 125 |
-
title={DeepSeek-VL2: Mixture-of-Experts Vision-Language Models for Advanced Multimodal Understanding},
|
| 126 |
-
author={
|
| 127 |
year={2024},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
}
|
| 129 |
```
|
| 130 |
|
|
|
|
| 37 |
pip install -e .
|
| 38 |
```
|
| 39 |
|
| 40 |
+
### Notifications
|
| 41 |
+
1. We suggest to use a temperature T <= 0.7 when sampling. We observe a larger temperature decreases the generation quality.
|
| 42 |
+
2. To keep the number of tokens managable in the context window, we apply dynamic tiling strategy to <=2 images. When there are >=3 images, we directly pad the images to 384*384 as inputs without tiling.
|
| 43 |
+
3. The main difference between DeepSeek-VL2-Tiny, DeepSeek-VL2-Small and DeepSeek-VL2 is the base LLM.
|
| 44 |
+
|
| 45 |
### Simple Inference Example
|
| 46 |
|
| 47 |
```python
|
|
|
|
| 126 |
## 5. Citation
|
| 127 |
|
| 128 |
```
|
| 129 |
+
@misc{wu2024deepseekvl2mixtureofexpertsvisionlanguagemodels,
|
| 130 |
+
title={DeepSeek-VL2: Mixture-of-Experts Vision-Language Models for Advanced Multimodal Understanding},
|
| 131 |
+
author={Zhiyu Wu and Xiaokang Chen and Zizheng Pan and Xingchao Liu and Wen Liu and Damai Dai and Huazuo Gao and Yiyang Ma and Chengyue Wu and Bingxuan Wang and Zhenda Xie and Yu Wu and Kai Hu and Jiawei Wang and Yaofeng Sun and Yukun Li and Yishi Piao and Kang Guan and Aixin Liu and Xin Xie and Yuxiang You and Kai Dong and Xingkai Yu and Haowei Zhang and Liang Zhao and Yisong Wang and Chong Ruan},
|
| 132 |
year={2024},
|
| 133 |
+
eprint={2412.10302},
|
| 134 |
+
archivePrefix={arXiv},
|
| 135 |
+
primaryClass={cs.CV},
|
| 136 |
+
url={https://arxiv.org/abs/2412.10302},
|
| 137 |
}
|
| 138 |
```
|
| 139 |
|