Coverage for transformer_lens/model_bridge/supported_architectures/glm_moe_dsa.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.10.1, created at 2026-09-21 19:27 +0000

1"""GLM-MoE-DSA architecture adapter.""" 

2 

3from transformer_lens.model_bridge.generalized_components.glm_moe_dsa_attention import ( 

4 GlmMoeDsaAttentionBridge, 

5) 

6from transformer_lens.model_bridge.supported_architectures.deepseek_v2 import ( 

7 DeepSeekMLAFamilyArchitectureAdapter, 

8) 

9 

10 

11class GlmMoeDsaArchitectureAdapter(DeepSeekMLAFamilyArchitectureAdapter): 

12 """Architecture adapter for Z.ai GLM-5 / GLM-5.1 DSA models. 

13 

14 GLM-MoE-DSA combines MLA-style latent attention, a learned sparse-attention 

15 indexer, dense early MLP layers, and sparse MoE later layers. Checkpoints 

16 always compress Q, so the family's required-Q default holds. 

17 """ 

18 

19 attention_cls = GlmMoeDsaAttentionBridge 

20 eager_attention = True 

21 prepend_bos = False