Views
No views yet
Qwen/Qwen3.5-9B-Base for 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.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).1import os
2os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
3
4# --- text-only (loads just the language model, like transformers' Qwen3_5ForCausalLM) ---
5from zeromodels.models.qwen3_5 import Qwen3_5TextGenerate, Qwen3_5Tokenizer
6
7model = Qwen3_5TextGenerate.from_weights("zeromodels/qwen3.5-9b-base")
8tokenizer = Qwen3_5Tokenizer.from_weights("zeromodels/qwen3.5-9b-base")
9outputs = model.generate(**tokenizer("The capital of France is"), max_new_tokens=32)
10print(tokenizer.decode(outputs[0]))
11
12# --- image + text (the full vision-language model) ---
13from PIL import Image
14from zeromodels.models.qwen3_5 import Qwen3_5ConditionalGenerate, Qwen3_5Processor
15
16model = Qwen3_5ConditionalGenerate.from_weights("zeromodels/qwen3.5-9b-base")
17processor = Qwen3_5Processor.from_weights("zeromodels/qwen3.5-9b-base")
18inputs = processor(conversation=[
19 {"role": "user", "content": [
20 {"type": "image", "image": Image.open("photo.jpg")},
21 {"type": "text", "text": "Describe this image in one sentence."},
22 ]}
23])
24outputs = model.generate(**inputs, max_new_tokens=64)
25print(processor.decode(outputs[0]))