glm-4.6v-flash / README.md
IMvision12's picture
Super-squash branch 'main' using huggingface_hub
b3119ea
|
Raw
History Blame Contribute Delete
2.53 kB
---
pipeline_tag: image-text-to-text
license: mit
base_model: zai-org/GLM-4.6V-Flash
library_name: kerasformers
language:
- en
- zh
tags:
- keras
- kerasformers
- glm
- glm4v
- multimodal
- vision
- image-text-to-text
- pytorch
- jax
- tf
---
# Run GLM-4V with Keras 3: JAX, PyTorch, or TensorFlow
[![GitHub](https://img.shields.io/badge/GitHub-KerasFormers-181717?logo=github)](https://github.com/IMvision12/KerasFormers) [![Docs](https://img.shields.io/badge/Docs-GLM-1f6feb)](https://imvision12.github.io/KerasFormers/glm4v/) [![HuggingFace](https://img.shields.io/badge/HuggingFace-GLM-ffd21e?logo=huggingface&logoColor=black)](https://huggingface.co/collections/kerasformers/glm-6a83b575b7af91f0daac58ee)
# kerasformers/glm-4.6v-flash
Pure-**Keras 3** conversion of [`zai-org/GLM-4.6V-Flash`](https://huggingface.co/zai-org/GLM-4.6V-Flash) for [kerasformers](https://github.com/IMvision12/KerasFormers). One implementation runs unmodified on **TensorFlow / Torch / JAX**. **GLM-4.6V-Flash** is a vision-language model (GLM-4V vision tower + GLM-4 dense decoder) served as **image + text -> text** via `Glm4vProcessor`; weights are stored in **bfloat16**.
For model details, license, and usage terms, see the upstream [model card](https://huggingface.co/zai-org/GLM-4.6V-Flash).
Paper: [GLM-4.1V-Thinking: Towards Versatile Multimodal Reasoning with Scalable Reinforcement Learning (arXiv:2507.01006)](https://arxiv.org/abs/2507.01006) · [HF Papers](https://huggingface.co/papers/2507.01006)
## ✨ Quick start
```python
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from PIL import Image
from kerasformers.models.glm4v import Glm4vConditionalGenerate, Glm4vProcessor
model = Glm4vConditionalGenerate.from_weights("kerasformers/glm-4.6v-flash")
processor = Glm4vProcessor.from_weights("kerasformers/glm-4.6v-flash")
inputs = processor(conversation=[
{"role": "user", "content": [
{"type": "image", "image": Image.open("photo.jpg")},
{"type": "text", "text": "Describe this image in one sentence."},
]}
])
outputs = model.generate(**inputs, max_new_tokens=64)
print(processor.decode(outputs[0]))
```
Load any GLM variant the same way with `from_weights("kerasformers/<variant>")`. Browse them all in the [GLM collection](https://huggingface.co/collections/kerasformers/glm-6a83b575b7af91f0daac58ee).
## 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).