Qwen3
Collection
13 items • Updated
How to use kerasformers/qwen3-4b-instruct-2507 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
How to use kerasformers/qwen3-4b-instruct-2507 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/qwen3-4b-instruct-2507")
Pure-Keras 3 conversion of Qwen/Qwen3-4B-Instruct-2507 for kerasformers. One implementation runs unmodified on TensorFlow / Torch / JAX. This is a dense Qwen3; weights are stored in bfloat16.
For model details, license, and usage terms, see the upstream model card.
Paper: Qwen3 Technical Report (arXiv:2505.09388) · HF Papers
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from kerasformers.models.qwen3 import Qwen3TextGenerate, Qwen3Tokenizer
model = Qwen3TextGenerate.from_weights("kerasformers/qwen3-4b-instruct-2507")
tokenizer = Qwen3Tokenizer.from_weights("kerasformers/qwen3-4b-instruct-2507")
inputs = tokenizer("Give me a short introduction to large language models.")
outputs = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(outputs[0]))
A huge thank you to the Qwen team at Alibaba for creating and releasing these models.
License: Apache 2.0.
Base model
Qwen/Qwen3-4B-Instruct-2507