Instructions to use kerasformers/qwen2-vl-72b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasFormers
How to use kerasformers/qwen2-vl-72b with KerasFormers:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Keras
How to use kerasformers/qwen2-vl-72b with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://kerasformers/qwen2-vl-72b") - Notebooks
- Google Colab
- Kaggle
Run Qwen2-VL with Keras 3: JAX, PyTorch, or TensorFlow
kerasformers/qwen2-vl-72b
Pure-Keras 3 conversion of Qwen/Qwen2-VL-72B for kerasformers. One implementation runs unmodified on TensorFlow / Torch / JAX. This is the 72B variant, served here as image + text -> text via Qwen2VLProcessor; 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: 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 kerasformers.models.qwen2_vl import Qwen2VLTextGenerate, Qwen2VLProcessor
model = Qwen2VLTextGenerate.from_weights("kerasformers/qwen2-vl-72b")
processor = Qwen2VLProcessor.from_weights("kerasformers/qwen2-vl-72b")
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 kerasformers.models.qwen2_vl import Qwen2VLConditionalGenerate, Qwen2VLProcessor
model = Qwen2VLConditionalGenerate.from_weights("kerasformers/qwen2-vl-72b")
processor = Qwen2VLProcessor.from_weights("kerasformers/qwen2-vl-72b")
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-VL variant the same way with from_weights("kerasformers/<variant>"):
| Variant | Hub |
|---|---|
qwen2-vl-72b |
kerasformers/qwen2-vl-72b |
qwen2-vl-72b-instruct |
kerasformers/qwen2-vl-72b-instruct |
Special Thanks
A huge thank you to the Qwen team at Alibaba for creating and releasing these models.
License: Qwen license (see the upstream license).
- Downloads last month
- 36
Model tree for kerasformers/qwen2-vl-72b
Base model
Qwen/Qwen2-VL-72B