Implementation:Open compass VLMEvalKit GLM4v
| Field | Value |
|---|---|
| source | VLMEvalKit |
| domain | Vision, Model_Architecture |
Overview
VLM adapter for the GLM-4V model enabling benchmark evaluation in VLMEvalKit.
Description
GLM4v inherits from BaseModel and wraps the GLM-4V model for use within the VLMEvalKit evaluation framework. It initializes the model and tokenizer/processor from a HuggingFace model path (default: THUDM/glm-4v-9b) and provides the generate_inner method for inference. Also includes GLMThinking (GLM-4.1V-9B-Thinking) and CogVlm adapter classes.
Usage
Register in vlmeval/config.py via supported_VLM and invoke through the standard evaluation pipeline.
Code Reference
- Source:
vlmeval/vlm/cogvlm.py, Lines: L1-322 - Import:
from vlmeval.vlm.cogvlm import GLM4v
Signature:
class GLM4v(BaseModel):
INSTALL_REQ = False
INTERLEAVE = False
def __init__(self, model_path='THUDM/glm-4v-9b', **kwargs): ...
def generate_inner(self, message, dataset=None): ...
I/O Contract
| Direction | Description |
|---|---|
| Inputs | message — list of dicts with type (text/image) and value; dataset — optional dataset name for custom prompting |
| Outputs | generate_inner() returns str (model response text) |
Usage Examples
from vlmeval.vlm.cogvlm import GLM4v
model = GLM4v(model_path='path/to/model')
response = model.generate_inner(message)