Downloads · 30 days
14
1% of all-time downloads
zeromodels/qwen2-7b-instruct
qwen2-7b-instruct is a text generation model from zeromodels. Use it when you need the model to write or continue text. It is set up for zeromodels. The card lists the license as apache-2.0.
Paper: Qwen2 Technical Report (arXiv:2407.10671) · HF Papers
Downloads · 30 days
14
1% of all-time downloads
All-time downloads
1.7K
Public
Repo size
15.2 GB
Likes
0
Public
Click a slice to open those files.
.h515.2 GB · 100%
From the Hugging Face model README
Paper: Qwen2 Technical Report (arXiv:2407.10671) · HF Papers
Qwen2 is Alibaba's decoder-only transformer family: grouped-query attention with q/k/v bias, SwiGLU MLPs, RMSNorm, and rotary positions, in dense 0.5B-72B sizes (plus the Qwen2-57B-A14B mixture-of-experts), as base and instruct variants.
For more details on the model, please see the upstream model card.
Pure-Keras 3 conversion of Qwen/Qwen2-7B-Instruct for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX.
This is an instruct (chat-tuned) checkpoint; load Qwen2Tokenizer so the chat template is applied.
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from zeromodels.models.qwen2 import Qwen2TextGenerate, Qwen2Tokenizer
model = Qwen2TextGenerate.from_weights("zeromodels/qwen2-7b-instruct")
tokenizer = Qwen2Tokenizer.from_weights("zeromodels/qwen2-7b-instruct")
inputs = tokenizer([
{"role": "user", "content": "Explain rotary embeddings in one sentence."}
])
outputs = model.generate(**inputs, max_new_tokens=64)
print(tokenizer.decode(outputs[0]))
Load any Qwen2 variant the same way with from_weights("zeromodels/<variant>"):
| Variant | Hub | Type |
|---|---|---|
qwen2-0.5b | zeromodels/qwen2-0.5b | base |
qwen2-0.5b-instruct | zeromodels/qwen2-0.5b-instruct | instruct |
qwen2-1.5b | zeromodels/qwen2-1.5b | base |
qwen2-1.5b-instruct | zeromodels/qwen2-1.5b-instruct | instruct |
qwen2-7b | zeromodels/qwen2-7b | base |
qwen2-7b-instruct | zeromodels/qwen2-7b-instruct | instruct |
qwen2-72b | zeromodels/qwen2-72b | base |
qwen2-72b-instruct | zeromodels/qwen2-72b-instruct | instruct |
qwen2-57b-a14b | zeromodels/qwen2-57b-a14b | MoE base |
qwen2-57b-a14b-instruct | zeromodels/qwen2-57b-a14b-instruct | MoE instruct |
qwen1.5-moe-a2.7b | zeromodels/qwen1.5-moe-a2.7b | MoE base |
qwen1.5-moe-a2.7b-chat | zeromodels/qwen1.5-moe-a2.7b-chat | MoE chat |
KERAS_BACKEND before importing Keras / zeromodels.Qwen2Tokenizer.from_weights(...) so the chat template matches.load_dtype="bfloat16" or quantization="int8".hf: prefix, e.g. Qwen2TextGenerate.from_weights("hf:Qwen/Qwen2-7B-Instruct").A huge thank you to the Qwen team at Alibaba for creating and releasing these models.
License: Apache 2.0.