Instructions to use zeromodels/qwen2.5-vl-7b-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ZeroModels
How to use zeromodels/qwen2.5-vl-7b-instruct with ZeroModels:
# pip install -U zeromodels # ZeroModels is pure Keras 3, so pick a backend: "jax", "torch" or "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" from zeromodels import AutoZModel # AutoZModel reads the repo's model_type and loads the matching class. # For a task head use the matching loader, e.g. AutoZMImageClassify / AutoZMDetect / # AutoZMSemanticSegment / AutoZMTextGenerate (see zeromodels.auto). model = AutoZModel.from_weights("zeromodels/qwen2.5-vl-7b-instruct") - Keras
How to use zeromodels/qwen2.5-vl-7b-instruct with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://zeromodels/qwen2.5-vl-7b-instruct") - Notebooks
- Google Colab
- Kaggle
pipeline_tag: image-text-to-text
license: apache-2.0
base_model: Qwen/Qwen2.5-VL-7B-Instruct
library_name: zeromodels
language:
- en
tags:
- keras
- zeromodels
- qwen2_5_vl
- qwen2.5-vl
- multimodal
- vision
- image-text-to-text
- pytorch
- jax
- tf
See our collection for all Qwen2.5-VL sizes.
Run Qwen2.5-VL with Keras 3: JAX, PyTorch, or TensorFlow
zeromodels/qwen2.5-vl-7b-instruct
Pure-Keras 3 conversion of Qwen/Qwen2.5-VL-7B-Instruct for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX. This is the 7B variant, served here as image + text -> text via Qwen2_5VLProcessor; weights are stored in bfloat16.
For model details, license, and usage terms, see the upstream model card.
Paper: Qwen2-VL: Enhancing Vision-Language Model's Perception of the World at Any Resolution (arXiv:2409.12191) · HF Papers
Paper: YaRN: Efficient Context Window Extension of Large Language Models (arXiv:2309.00071) · HF Papers
Paper: Qwen-VL: A Frontier Large Vision-Language Model with Versatile Abilities (arXiv:2308.12966) · HF Papers
✨ Quick start
Text-only
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from zeromodels.models.qwen2_5_vl import Qwen2_5VLTextGenerate, Qwen2_5VLProcessor
model = Qwen2_5VLTextGenerate.from_weights("zeromodels/qwen2.5-vl-7b-instruct")
processor = Qwen2_5VLProcessor.from_weights("zeromodels/qwen2.5-vl-7b-instruct")
inputs = processor(conversation=[
{"role": "user", "content": [{"type": "text", "text": "Hello, who are you?"}]}
])
outputs = model.generate(**inputs, max_new_tokens=64)
print(processor.decode(outputs[0]))
Image + text
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from PIL import Image
from zeromodels.models.qwen2_5_vl import Qwen2_5VLConditionalGenerate, Qwen2_5VLProcessor
model = Qwen2_5VLConditionalGenerate.from_weights("zeromodels/qwen2.5-vl-7b-instruct")
processor = Qwen2_5VLProcessor.from_weights("zeromodels/qwen2.5-vl-7b-instruct")
inputs = processor(conversation=[
{"role": "user", "content": [
{"type": "image", "image": Image.open("photo.jpg")},
{"type": "text", "text": "Describe this image in one sentence."},
]}
])
outputs = model.generate(**inputs, max_new_tokens=64)
print(processor.decode(outputs[0]))
Load any Qwen2.5-VL variant the same way with from_weights("zeromodels/<variant>"):
| Variant | Hub |
|---|---|
qwen2.5-vl-3b-instruct |
zeromodels/qwen2.5-vl-3b-instruct |
qwen2.5-vl-7b-instruct |
zeromodels/qwen2.5-vl-7b-instruct |
qwen2.5-vl-32b-instruct |
zeromodels/qwen2.5-vl-32b-instruct |
qwen2.5-vl-72b-instruct |
zeromodels/qwen2.5-vl-72b-instruct |
Special Thanks
A huge thank you to the Qwen team at Alibaba for creating and releasing these models.
License: Apache 2.0.