Instructions to use zeromodels/qwen3.5-4b-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ZeroModels
How to use zeromodels/qwen3.5-4b-base 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/qwen3.5-4b-base 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/qwen3.5-4b-base") - Notebooks
- Google Colab
- Kaggle
Migrate to zeromodels (rename kf_*.json -> zm_*.json, fix refs in config + README, ensure tag + badge)
Browse files- README.md +11 -11
- kf_config.json → zm_config.json +3 -3
- kf_preprocessor.json → zm_preprocessor.json +3 -3
README.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
| 2 |
pipeline_tag: image-text-to-text
|
| 3 |
license: apache-2.0
|
| 4 |
base_model: Qwen/Qwen3.5-4B-Base
|
| 5 |
-
library_name:
|
| 6 |
language:
|
| 7 |
- en
|
| 8 |
tags:
|
| 9 |
- keras
|
| 10 |
-
-
|
| 11 |
- qwen3_5
|
| 12 |
- qwen
|
| 13 |
- multimodal
|
|
@@ -20,11 +20,11 @@ tags:
|
|
| 20 |
|
| 21 |
# Run Qwen3.5 with Keras 3: JAX, PyTorch, or TensorFlow
|
| 22 |
|
| 23 |
-
[ for [
|
| 28 |
|
| 29 |
This repo hosts the full VLM. Load it with **`Qwen3_5ConditionalGenerate`** for image + text, or with **`Qwen3_5TextGenerate`** for text-only (it reads just the language model and drops the vision tower, like transformers' `Qwen3_5ForCausalLM`).
|
| 30 |
|
|
@@ -37,19 +37,19 @@ import os
|
|
| 37 |
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
|
| 38 |
|
| 39 |
# --- text-only (loads just the language model, like transformers' Qwen3_5ForCausalLM) ---
|
| 40 |
-
from
|
| 41 |
|
| 42 |
-
model = Qwen3_5TextGenerate.from_weights("
|
| 43 |
-
tokenizer = Qwen3_5Tokenizer.from_weights("
|
| 44 |
outputs = model.generate(**tokenizer("The capital of France is"), max_new_tokens=32)
|
| 45 |
print(tokenizer.decode(outputs[0]))
|
| 46 |
|
| 47 |
# --- image + text (the full vision-language model) ---
|
| 48 |
from PIL import Image
|
| 49 |
-
from
|
| 50 |
|
| 51 |
-
model = Qwen3_5ConditionalGenerate.from_weights("
|
| 52 |
-
processor = Qwen3_5Processor.from_weights("
|
| 53 |
inputs = processor(conversation=[
|
| 54 |
{"role": "user", "content": [
|
| 55 |
{"type": "image", "image": Image.open("photo.jpg")},
|
|
|
|
| 2 |
pipeline_tag: image-text-to-text
|
| 3 |
license: apache-2.0
|
| 4 |
base_model: Qwen/Qwen3.5-4B-Base
|
| 5 |
+
library_name: zeromodels
|
| 6 |
language:
|
| 7 |
- en
|
| 8 |
tags:
|
| 9 |
- keras
|
| 10 |
+
- zeromodels
|
| 11 |
- qwen3_5
|
| 12 |
- qwen
|
| 13 |
- multimodal
|
|
|
|
| 20 |
|
| 21 |
# Run Qwen3.5 with Keras 3: JAX, PyTorch, or TensorFlow
|
| 22 |
|
| 23 |
+
[](https://github.com/IMvision12/ZeroModels) [](https://imvision12.github.io/ZeroModels/qwen3_5/) [](https://huggingface.co/collections/zeromodels/qwen35-6a7e5421737d73e63669ebb9)
|
| 24 |
|
| 25 |
+
# zeromodels/qwen3.5-4b-base
|
| 26 |
|
| 27 |
+
Pure-**Keras 3** conversion of [`Qwen/Qwen3.5-4B-Base`](https://huggingface.co/Qwen/Qwen3.5-4B-Base) for [zeromodels](https://github.com/IMvision12/ZeroModels). One implementation runs unmodified on **TensorFlow / Torch / JAX**. Qwen3.5 is a native vision-language model: a Qwen3-VL vision tower + a dense Gated-DeltaNet / gated-full-attention hybrid text decoder. Weights are stored in **bfloat16**.
|
| 28 |
|
| 29 |
This repo hosts the full VLM. Load it with **`Qwen3_5ConditionalGenerate`** for image + text, or with **`Qwen3_5TextGenerate`** for text-only (it reads just the language model and drops the vision tower, like transformers' `Qwen3_5ForCausalLM`).
|
| 30 |
|
|
|
|
| 37 |
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
|
| 38 |
|
| 39 |
# --- text-only (loads just the language model, like transformers' Qwen3_5ForCausalLM) ---
|
| 40 |
+
from zeromodels.models.qwen3_5 import Qwen3_5TextGenerate, Qwen3_5Tokenizer
|
| 41 |
|
| 42 |
+
model = Qwen3_5TextGenerate.from_weights("zeromodels/qwen3.5-4b-base")
|
| 43 |
+
tokenizer = Qwen3_5Tokenizer.from_weights("zeromodels/qwen3.5-4b-base")
|
| 44 |
outputs = model.generate(**tokenizer("The capital of France is"), max_new_tokens=32)
|
| 45 |
print(tokenizer.decode(outputs[0]))
|
| 46 |
|
| 47 |
# --- image + text (the full vision-language model) ---
|
| 48 |
from PIL import Image
|
| 49 |
+
from zeromodels.models.qwen3_5 import Qwen3_5ConditionalGenerate, Qwen3_5Processor
|
| 50 |
|
| 51 |
+
model = Qwen3_5ConditionalGenerate.from_weights("zeromodels/qwen3.5-4b-base")
|
| 52 |
+
processor = Qwen3_5Processor.from_weights("zeromodels/qwen3.5-4b-base")
|
| 53 |
inputs = processor(conversation=[
|
| 54 |
{"role": "user", "content": [
|
| 55 |
{"type": "image", "image": Image.open("photo.jpg")},
|
kf_config.json → zm_config.json
RENAMED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
-
"library_name": "
|
| 3 |
-
"
|
| 4 |
-
"model_module": "
|
| 5 |
"model_class": "Qwen3_5ConditionalGenerate",
|
| 6 |
"variant": "qwen3.5-4b-base",
|
| 7 |
"weights": "model.weights.json",
|
|
|
|
| 1 |
{
|
| 2 |
+
"library_name": "zeromodels",
|
| 3 |
+
"zeromodels_version": "1.2.3",
|
| 4 |
+
"model_module": "zeromodels.models.qwen3_5",
|
| 5 |
"model_class": "Qwen3_5ConditionalGenerate",
|
| 6 |
"variant": "qwen3.5-4b-base",
|
| 7 |
"weights": "model.weights.json",
|
kf_preprocessor.json → zm_preprocessor.json
RENAMED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
-
"library_name": "
|
| 3 |
-
"
|
| 4 |
-
"preprocessor_module": "
|
| 5 |
"preprocessor_class": "Qwen2VLImageProcessor",
|
| 6 |
"variant": "qwen3.5-4b-base",
|
| 7 |
"patch_size": 14,
|
|
|
|
| 1 |
{
|
| 2 |
+
"library_name": "zeromodels",
|
| 3 |
+
"zeromodels_version": "1.2.3",
|
| 4 |
+
"preprocessor_module": "zeromodels.models.qwen2_vl",
|
| 5 |
"preprocessor_class": "Qwen2VLImageProcessor",
|
| 6 |
"variant": "qwen3.5-4b-base",
|
| 7 |
"patch_size": 14,
|