--- license: mit library_name: transformers pipeline_tag: text-generation base_model: zai-org/GLM-4.1V-9B-Thinking tags: - transformers - safetensors - glm4 - glm4v - text-generation - text-only - reasoning - en - zh --- # GLM-4.1V-9B-Thinking Text-Only This is a text-only extraction of [`zai-org/GLM-4.1V-9B-Thinking`](https://huggingface.co/zai-org/GLM-4.1V-9B-Thinking). It keeps the language model weights and tokenizer assets, and removes the vision/multimodal components. This repository is not an official ZhipuAI/zai-org release. ## Conversion - Source model: `zai-org/GLM-4.1V-9B-Thinking` - Target model type: `glm4` - Target architecture: `Glm4ForCausalLM` - Kept tensors: 523 - Dropped tensors: 181 - Weight format: sharded `safetensors` - Weight files: 4 shards at repository root The original VLM config uses a multimodal GLM4V architecture. For text-only loading with Transformers `AutoModelForCausalLM`, the language backbone was converted to a loadable `glm4` CausalLM config. ## Validation Validated locally with Transformers: - `AutoConfig.from_pretrained(...)` loads as `Glm4Config` - `AutoTokenizer.from_pretrained(...)` loads successfully - `AutoModelForCausalLM.from_pretrained(..., torch_dtype="auto", low_cpu_mem_usage=True)` loads as `Glm4ForCausalLM` - A tiny forward pass succeeds and returns logits with shape `(1, 1, 151552)` - No vision/projector/multimodal tensor names remain in the sharded weight index ## Usage ```python import torch from transformers import AutoModelForCausalLM, AutoTokenizer model_id = "sasa2000/glm-4-1v-9b-thinking-text-only" tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained( model_id, torch_dtype="auto", device_map="auto", ) inputs = tokenizer("Explain why the sky looks blue.", return_tensors="pt").to(model.device) with torch.no_grad(): output_ids = model.generate(**inputs, max_new_tokens=128) print(tokenizer.decode(output_ids[0], skip_special_tokens=True)) ``` ## Limitations This checkpoint is text-only. Image and video inputs are not supported because the vision encoder, multimodal projector, and related preprocessing assets were removed. Please review the upstream model card and license for the original model's intended use, limitations, and terms.