Image-Text-to-Text
ZeroModels
Keras
PyTorch
JAX
TensorFlow
English
qwen2_5_vl
qwen2.5-vl
multimodal
vision
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:
# 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 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
Migrate to zeromodels (rename kf_*.json -> zm_*.json, fix refs in config + README, ensure tag + badge)
Browse files- README.md +17 -17
- kf_config.json → zm_config.json +3 -3
- kf_preprocessor.json → zm_preprocessor.json +21 -21
README.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
| 2 |
pipeline_tag: image-text-to-text
|
| 3 |
license: apache-2.0
|
| 4 |
base_model: Qwen/Qwen2.5-VL-7B-Instruct
|
| 5 |
-
library_name:
|
| 6 |
language:
|
| 7 |
- en
|
| 8 |
tags:
|
| 9 |
- keras
|
| 10 |
-
-
|
| 11 |
- qwen2_5_vl
|
| 12 |
- qwen2.5-vl
|
| 13 |
- multimodal
|
|
@@ -18,15 +18,15 @@ tags:
|
|
| 18 |
- tf
|
| 19 |
---
|
| 20 |
|
| 21 |
-
*See [our collection](https://huggingface.co/collections/
|
| 22 |
|
| 23 |
# Run Qwen2.5-VL with Keras 3: JAX, PyTorch, or TensorFlow
|
| 24 |
|
| 25 |
-
[ for [
|
| 30 |
|
| 31 |
For model details, license, and usage terms, see the upstream [model card](https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct).
|
| 32 |
|
|
@@ -44,10 +44,10 @@ Paper: [Qwen-VL: A Frontier Large Vision-Language Model with Versatile Abilities
|
|
| 44 |
import os
|
| 45 |
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
|
| 46 |
|
| 47 |
-
from
|
| 48 |
|
| 49 |
-
model = Qwen2_5VLTextGenerate.from_weights("
|
| 50 |
-
processor = Qwen2_5VLProcessor.from_weights("
|
| 51 |
|
| 52 |
inputs = processor(conversation=[
|
| 53 |
{"role": "user", "content": [{"type": "text", "text": "Hello, who are you?"}]}
|
|
@@ -63,10 +63,10 @@ import os
|
|
| 63 |
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
|
| 64 |
|
| 65 |
from PIL import Image
|
| 66 |
-
from
|
| 67 |
|
| 68 |
-
model = Qwen2_5VLConditionalGenerate.from_weights("
|
| 69 |
-
processor = Qwen2_5VLProcessor.from_weights("
|
| 70 |
|
| 71 |
inputs = processor(conversation=[
|
| 72 |
{"role": "user", "content": [
|
|
@@ -78,14 +78,14 @@ outputs = model.generate(**inputs, max_new_tokens=64)
|
|
| 78 |
print(processor.decode(outputs[0]))
|
| 79 |
```
|
| 80 |
|
| 81 |
-
Load any Qwen2.5-VL variant the same way with `from_weights("
|
| 82 |
|
| 83 |
| Variant | Hub |
|
| 84 |
| --- | --- |
|
| 85 |
-
| `qwen2.5-vl-3b-instruct` | [
|
| 86 |
-
| `qwen2.5-vl-7b-instruct` | [
|
| 87 |
-
| `qwen2.5-vl-32b-instruct` | [
|
| 88 |
-
| `qwen2.5-vl-72b-instruct` | [
|
| 89 |
|
| 90 |
## Special Thanks
|
| 91 |
|
|
|
|
| 2 |
pipeline_tag: image-text-to-text
|
| 3 |
license: apache-2.0
|
| 4 |
base_model: Qwen/Qwen2.5-VL-7B-Instruct
|
| 5 |
+
library_name: zeromodels
|
| 6 |
language:
|
| 7 |
- en
|
| 8 |
tags:
|
| 9 |
- keras
|
| 10 |
+
- zeromodels
|
| 11 |
- qwen2_5_vl
|
| 12 |
- qwen2.5-vl
|
| 13 |
- multimodal
|
|
|
|
| 18 |
- tf
|
| 19 |
---
|
| 20 |
|
| 21 |
+
*See [our collection](https://huggingface.co/collections/zeromodels/qwen25-vl-6a7cc9f463d6956b6c3ba911) for all Qwen2.5-VL sizes.*
|
| 22 |
|
| 23 |
# Run Qwen2.5-VL with Keras 3: JAX, PyTorch, or TensorFlow
|
| 24 |
|
| 25 |
+
[](https://github.com/IMvision12/ZeroModels) [](https://imvision12.github.io/ZeroModels/qwen2_5_vl/) [](https://huggingface.co/collections/zeromodels/qwen25-vl-6a7cc9f463d6956b6c3ba911)
|
| 26 |
|
| 27 |
+
# zeromodels/qwen2.5-vl-7b-instruct
|
| 28 |
|
| 29 |
+
Pure-**Keras 3** conversion of [`Qwen/Qwen2.5-VL-7B-Instruct`](https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct) for [zeromodels](https://github.com/IMvision12/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**.
|
| 30 |
|
| 31 |
For model details, license, and usage terms, see the upstream [model card](https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct).
|
| 32 |
|
|
|
|
| 44 |
import os
|
| 45 |
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
|
| 46 |
|
| 47 |
+
from zeromodels.models.qwen2_5_vl import Qwen2_5VLTextGenerate, Qwen2_5VLProcessor
|
| 48 |
|
| 49 |
+
model = Qwen2_5VLTextGenerate.from_weights("zeromodels/qwen2.5-vl-7b-instruct")
|
| 50 |
+
processor = Qwen2_5VLProcessor.from_weights("zeromodels/qwen2.5-vl-7b-instruct")
|
| 51 |
|
| 52 |
inputs = processor(conversation=[
|
| 53 |
{"role": "user", "content": [{"type": "text", "text": "Hello, who are you?"}]}
|
|
|
|
| 63 |
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
|
| 64 |
|
| 65 |
from PIL import Image
|
| 66 |
+
from zeromodels.models.qwen2_5_vl import Qwen2_5VLConditionalGenerate, Qwen2_5VLProcessor
|
| 67 |
|
| 68 |
+
model = Qwen2_5VLConditionalGenerate.from_weights("zeromodels/qwen2.5-vl-7b-instruct")
|
| 69 |
+
processor = Qwen2_5VLProcessor.from_weights("zeromodels/qwen2.5-vl-7b-instruct")
|
| 70 |
|
| 71 |
inputs = processor(conversation=[
|
| 72 |
{"role": "user", "content": [
|
|
|
|
| 78 |
print(processor.decode(outputs[0]))
|
| 79 |
```
|
| 80 |
|
| 81 |
+
Load any Qwen2.5-VL variant the same way with `from_weights("zeromodels/<variant>")`:
|
| 82 |
|
| 83 |
| Variant | Hub |
|
| 84 |
| --- | --- |
|
| 85 |
+
| `qwen2.5-vl-3b-instruct` | [zeromodels/qwen2.5-vl-3b-instruct](https://huggingface.co/zeromodels/qwen2.5-vl-3b-instruct) |
|
| 86 |
+
| `qwen2.5-vl-7b-instruct` | [zeromodels/qwen2.5-vl-7b-instruct](https://huggingface.co/zeromodels/qwen2.5-vl-7b-instruct) |
|
| 87 |
+
| `qwen2.5-vl-32b-instruct` | [zeromodels/qwen2.5-vl-32b-instruct](https://huggingface.co/zeromodels/qwen2.5-vl-32b-instruct) |
|
| 88 |
+
| `qwen2.5-vl-72b-instruct` | [zeromodels/qwen2.5-vl-72b-instruct](https://huggingface.co/zeromodels/qwen2.5-vl-72b-instruct) |
|
| 89 |
|
| 90 |
## Special Thanks
|
| 91 |
|
kf_config.json → zm_config.json
RENAMED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
-
"library_name": "
|
| 3 |
-
"
|
| 4 |
-
"model_module": "
|
| 5 |
"model_class": "Qwen2_5VLConditionalGenerate",
|
| 6 |
"variant": "qwen2.5-vl-7b-instruct",
|
| 7 |
"weights": "model.weights.json",
|
|
|
|
| 1 |
{
|
| 2 |
+
"library_name": "zeromodels",
|
| 3 |
+
"zeromodels_version": "1.2.2",
|
| 4 |
+
"model_module": "zeromodels.models.qwen2_5_vl",
|
| 5 |
"model_class": "Qwen2_5VLConditionalGenerate",
|
| 6 |
"variant": "qwen2.5-vl-7b-instruct",
|
| 7 |
"weights": "model.weights.json",
|
kf_preprocessor.json → zm_preprocessor.json
RENAMED
|
@@ -1,22 +1,22 @@
|
|
| 1 |
-
{
|
| 2 |
-
"library_name": "
|
| 3 |
-
"
|
| 4 |
-
"preprocessor_module": "
|
| 5 |
-
"preprocessor_class": "Qwen2VLImageProcessor",
|
| 6 |
-
"variant": "qwen2.5-vl-7b-instruct",
|
| 7 |
-
"patch_size": 14,
|
| 8 |
-
"spatial_merge_size": 2,
|
| 9 |
-
"temporal_patch_size": 2,
|
| 10 |
-
"min_pixels": 3136,
|
| 11 |
-
"max_pixels": 1003520,
|
| 12 |
-
"image_mean": [
|
| 13 |
-
0.48145467042922974,
|
| 14 |
-
0.45782750844955444,
|
| 15 |
-
0.40821072459220886
|
| 16 |
-
],
|
| 17 |
-
"image_std": [
|
| 18 |
-
0.2686295509338379,
|
| 19 |
-
0.2613025903701782,
|
| 20 |
-
0.27577710151672363
|
| 21 |
-
]
|
| 22 |
}
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"library_name": "zeromodels",
|
| 3 |
+
"zeromodels_version": "1.2.2",
|
| 4 |
+
"preprocessor_module": "zeromodels.models.qwen2_vl",
|
| 5 |
+
"preprocessor_class": "Qwen2VLImageProcessor",
|
| 6 |
+
"variant": "qwen2.5-vl-7b-instruct",
|
| 7 |
+
"patch_size": 14,
|
| 8 |
+
"spatial_merge_size": 2,
|
| 9 |
+
"temporal_patch_size": 2,
|
| 10 |
+
"min_pixels": 3136,
|
| 11 |
+
"max_pixels": 1003520,
|
| 12 |
+
"image_mean": [
|
| 13 |
+
0.48145467042922974,
|
| 14 |
+
0.45782750844955444,
|
| 15 |
+
0.40821072459220886
|
| 16 |
+
],
|
| 17 |
+
"image_std": [
|
| 18 |
+
0.2686295509338379,
|
| 19 |
+
0.2613025903701782,
|
| 20 |
+
0.27577710151672363
|
| 21 |
+
]
|
| 22 |
}
|