Downloads · 30 days
13
43% of all-time downloads
zeromodels/glm-4-9b
glm-4-9b 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 other.
[](https://github.com/IMvision12/ZeroModels) [](https://imvision12.github.io/ZeroModels/glm/) [](https://huggingface.co/collections/zeromodels/glm-6a82b8f9f753e8dcae3ff3f7)
Downloads · 30 days
13
43% of all-time downloads
All-time downloads
30
Public
Repo size
18.8 GB
Likes
0
Public
Click a slice to open those files.
.h518.8 GB · 100%
From the Hugging Face model README
Pure-Keras 3 conversion of zai-org/glm-4-9b-hf for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX. This is a GLM-4-9B checkpoint served as text -> text; weights are stored in bfloat16.
For model details, license, and usage terms, see the upstream model card.
Paper: ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Tools (arXiv:2406.12793) · HF Papers
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from zeromodels.models.glm import GlmTextGenerate, GlmTokenizer
model = GlmTextGenerate.from_weights("zeromodels/glm-4-9b")
tokenizer = GlmTokenizer.from_weights("zeromodels/glm-4-9b")
messages = [{"role": "user", "content": "Name three prime numbers."}]
inputs = tokenizer(messages)
outputs = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(outputs[0]))
Load any GLM variant the same way with from_weights("zeromodels/<variant>"). Browse them all in the GLM collection.
A huge thank you to the Zhipu AI / THUDM team for creating and releasing the GLM models.
License: glm-4 (link).