Instructions to use zeromodels/glm-4-32b-base-0414 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ZeroModels
How to use zeromodels/glm-4-32b-base-0414 with ZeroModels:
# pip install -U zeromodels # ZeroModels is pure Keras 3, so pick a backend: "jax", "torch" or "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" from zeromodels import AutoZModel # AutoZModel reads the repo's model_type and loads the matching class. # For a task head use the matching loader, e.g. AutoZMImageClassify / AutoZMDetect / # AutoZMSemanticSegment / AutoZMTextGenerate (see zeromodels.auto). model = AutoZModel.from_weights("zeromodels/glm-4-32b-base-0414") - Keras
How to use zeromodels/glm-4-32b-base-0414 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/glm-4-32b-base-0414") - Notebooks
- Google Colab
- Kaggle
Run GLM-4-0414 with Keras 3: JAX, PyTorch, or TensorFlow
zeromodels/glm-4-32b-base-0414
Pure-Keras 3 conversion of zai-org/GLM-4-32B-Base-0414 for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX. This is a GLM-4-0414 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
✨ Quick start
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from zeromodels.models.glm4 import Glm4TextGenerate, Glm4Tokenizer
model = Glm4TextGenerate.from_weights("zeromodels/glm-4-32b-base-0414")
tokenizer = Glm4Tokenizer.from_weights("zeromodels/glm-4-32b-base-0414")
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.
Special Thanks
A huge thank you to the Zhipu AI / THUDM team for creating and releasing the GLM models.
License: mit (per the upstream model card).
- Downloads last month
- 6
Model tree for zeromodels/glm-4-32b-base-0414
Base model
zai-org/GLM-4-32B-Base-0414