Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/source/en/_toctree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,8 @@
title: GLM-4.7-Flash
- local: model_doc/glm_image
title: GLM-Image
- local: model_doc/glm_moe_dsa
title: GlmMoeDsa
- local: model_doc/openai-gpt
title: GPT
- local: model_doc/gpt_neo
Expand Down
61 changes: 61 additions & 0 deletions docs/source/en/model_doc/glm_moe_dsa.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!--Copyright 2026 the HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be rendered properly in your Markdown viewer.

-->
*This model was released on {release_date} and added to Hugging Face Transformers on 2026-02-08.*


# GlmMoeDsa

## Overview

The GlmMoeDsa model was proposed in [<INSERT PAPER NAME HERE>](<INSERT PAPER LINK HERE>) by <INSERT AUTHORS HERE>.
<INSERT SHORT SUMMARY HERE>

The abstract from the paper is the following:

<INSERT PAPER ABSTRACT HERE>

Tips:

<INSERT TIPS ABOUT MODEL HERE>

This model was contributed by [INSERT YOUR HF USERNAME HERE](https://huggingface.co/<INSERT YOUR HF USERNAME HERE>).
The original code can be found [here](<INSERT LINK TO GITHUB REPO HERE>).

## Usage examples

<INSERT SOME NICE EXAMPLES HERE>

## GlmMoeDsaConfig

[[autodoc]] GlmMoeDsaConfig

## GlmMoeDsaPreTrainedModel

[[autodoc]] GlmMoeDsaPreTrainedModel
- forward

## GlmMoeDsaModel

[[autodoc]] GlmMoeDsaModel
- forward

## GlmMoeDsaForCausalLM

[[autodoc]] GlmMoeDsaForCausalLM
- forward
1 change: 1 addition & 0 deletions src/transformers/conversion_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"ernie4_5_moe": "qwen2_moe",
"glm4_moe": "qwen2_moe",
"glm4_moe_lite": "qwen2_moe",
"glm_moe_dsa": "qwen2_moe",
"glm4v_moe": "qwen2_moe",
"longcat_flash": "qwen2_moe",
"solar_open": "qwen2_moe",
Expand Down
1 change: 1 addition & 0 deletions src/transformers/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
from .glm4v_moe import *
from .glm46v import *
from .glm_image import *
from .glm_moe_dsa import *
from .glm_ocr import *
from .glmasr import *
from .glpn import *
Expand Down
2 changes: 2 additions & 0 deletions src/transformers/models/auto/configuration_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
("glm_image_text", "GlmImageTextConfig"),
("glm_image_vision", "GlmImageVisionConfig"),
("glm_image_vqmodel", "GlmImageVQVAEConfig"),
("glm_moe_dsa", "GlmMoeDsaConfig"),
("glm_ocr", "GlmOcrConfig"),
("glm_ocr_text", "GlmOcrTextConfig"),
("glm_ocr_vision", "GlmOcrVisionConfig"),
Expand Down Expand Up @@ -661,6 +662,7 @@
("glm_image_text", "GlmImageText"),
("glm_image_vision", "GlmImageVisionModel"),
("glm_image_vqmodel", "GlmImageVQVAE"),
("glm_moe_dsa", "GlmMoeDsa"),
("glm_ocr", "Glmocr"),
("glm_ocr_text", "GlmOcrText"),
("glm_ocr_vision", "GlmOcrVisionModel"),
Expand Down
2 changes: 2 additions & 0 deletions src/transformers/models/auto/modeling_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ class _BaseModelWithGenerate(PreTrainedModel, GenerationMixin):
("glm_image_text", "GlmImageTextModel"),
("glm_image_vision", "GlmImageVisionModel"),
("glm_image_vqmodel", "GlmImageVQVAE"),
("glm_moe_dsa", "GlmMoeDsaModel"),
("glm_ocr", "GlmOcrModel"),
("glm_ocr_text", "GlmOcrTextModel"),
("glm_ocr_vision", "GlmOcrVisionModel"),
Expand Down Expand Up @@ -618,6 +619,7 @@ class _BaseModelWithGenerate(PreTrainedModel, GenerationMixin):
("glm4", "Glm4ForCausalLM"),
("glm4_moe", "Glm4MoeForCausalLM"),
("glm4_moe_lite", "Glm4MoeLiteForCausalLM"),
("glm_moe_dsa", "GlmMoeDsaForCausalLM"),
("got_ocr2", "GotOcr2ForConditionalGeneration"),
("gpt-sw3", "GPT2LMHeadModel"),
("gpt2", "GPT2LMHeadModel"),
Expand Down
28 changes: 28 additions & 0 deletions src/transformers/models/glm_moe_dsa/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2026 the HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import TYPE_CHECKING

from ...utils import _LazyModule
from ...utils.import_utils import define_import_structure


if TYPE_CHECKING:
from .configuration_glm_moe_dsa import *
from .modeling_glm_moe_dsa import *
else:
import sys

_file = globals()["__file__"]
sys.modules[__name__] = _LazyModule(__name__, _file, define_import_structure(_file), module_spec=__spec__)
Loading