--- pipeline_tag: image-text-to-text license: other license_name: deepseek license_link: https://huggingface.co/deepseek-ai/deepseek-vl-7b-chat/blob/main/LICENSE base_model: deepseek-ai/deepseek-vl-7b-chat library_name: kerasformers tags: - keras - kerasformers - deepseek-vl - vision-language - image-text-to-text - arxiv:2403.05525 - pytorch - jax - tf --- ## ***See [our collection](https://huggingface.co/collections/kerasformers/deepseek-vl-6a6ea961fe80d98b7c69b489) for all versions of DeepSeek-VL.*** # Run DeepSeek-VL with Keras 3: JAX, PyTorch, or TensorFlow [![GitHub](https://img.shields.io/badge/GitHub-KerasFormers-black?logo=github)](https://github.com/IMvision12/KerasFormers) [![Docs](https://img.shields.io/badge/Docs-DeepSeek--VL--Hybrid-blue)](https://imvision12.github.io/KerasFormers/deepseek_vl_hybrid/) [![Collection](https://img.shields.io/badge/HF-DeepSeek--VL%20collection-yellow)](https://huggingface.co/collections/kerasformers/deepseek-vl-6a6ea961fe80d98b7c69b489) # kerasformers/deepseek_vl_7b_chat Paper: [DeepSeek-VL: Towards Real-World Vision-Language Understanding (arXiv:2403.05525)](https://arxiv.org/abs/2403.05525) · [HF Papers](https://huggingface.co/papers/2403.05525) DeepSeek-VL **7B hybrid** uses a dual vision tower (SigLIP @384 + SAM-style @1024) and a 3-way aligner for finer detail and small text. Import from `kerasformers.models.deepseek_vl_hybrid` (not `deepseek_vl`). For more details on the model, please go to the upstream [model card](https://huggingface.co/deepseek-ai/deepseek-vl-7b-chat). Pure-**Keras 3** conversion of [`deepseek-ai/deepseek-vl-7b-chat`](https://huggingface.co/deepseek-ai/deepseek-vl-7b-chat) for [kerasformers](https://github.com/IMvision12/KerasFormers). One implementation runs unmodified on **TensorFlow / Torch / JAX**. This is a **vision-language** (chat) checkpoint (`DeepseekVLHybridConditionalGenerate`, 7B chat (SigLIP + SAM hybrid)). ## ✨ Quick start ```python import os os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow" from PIL import Image from kerasformers.models.deepseek_vl_hybrid import ( DeepseekVLHybridConditionalGenerate, DeepseekVLHybridProcessor, ) model = DeepseekVLHybridConditionalGenerate.from_weights("kerasformers/deepseek_vl_7b_chat") processor = DeepseekVLHybridProcessor.from_weights("kerasformers/deepseek_vl_7b_chat") image = Image.open("your_image.jpg") inputs = processor( conversation=[ { "role": "user", "content": [ {"type": "image", "image": image}, {"type": "text", "text": "Describe this image in one sentence."}, ], } ] ) outputs = model.generate(**inputs, max_new_tokens=64) print(processor.decode(outputs[0])) ``` Load any DeepSeek-VL variant the same way with `from_weights("kerasformers/")`: | Variant | Hub | Notes | |---|---|---| | `deepseek_vl_1.3b_base` | [`kerasformers/deepseek_vl_1.3b_base`](https://huggingface.co/kerasformers/deepseek_vl_1.3b_base) | 1.3B base | | `deepseek_vl_1.3b_chat` | [`kerasformers/deepseek_vl_1.3b_chat`](https://huggingface.co/kerasformers/deepseek_vl_1.3b_chat) | 1.3B chat | | `deepseek_vl_7b_base` | [`kerasformers/deepseek_vl_7b_base`](https://huggingface.co/kerasformers/deepseek_vl_7b_base) | 7B hybrid base | | `deepseek_vl_7b_chat` | [`kerasformers/deepseek_vl_7b_chat`](https://huggingface.co/kerasformers/deepseek_vl_7b_chat) | 7B hybrid chat | ## Tips - Set `KERAS_BACKEND` **before** importing Keras / kerasformers. - Prefer `Processor.from_weights(...)` so vision + tokenizer match. - 7B hybrid is a **different package** than 1.3B; do not mix imports. - See [docs](https://imvision12.github.io/KerasFormers/deepseek_vl_hybrid/) and [Loading Weights](https://imvision12.github.io/KerasFormers/loading_weights/). - Community / upstream safetensors still work via the `hf:` prefix, e.g. `DeepseekVLHybridConditionalGenerate.from_weights("hf:deepseek-ai/deepseek-vl-7b-chat")`. ## Special Thanks A huge thank you to the DeepSeek-VL authors for creating and releasing these models. License: DeepSeek (`other` / deepseek). See [LICENSE](https://huggingface.co/deepseek-ai/deepseek-vl-7b-chat/blob/main/LICENSE).