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
4 changes: 4 additions & 0 deletions mlx_lm/chat_templates/deepseek_v32.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ def encode_messages(
def apply_chat_template(
messages, continue_final_message=False, add_generation_prompt=False, **kwargs
):
if "enable_thinking" in kwargs:
kwargs["thinking_mode"] = (
"thinking" if kwargs.pop("enable_thinking") else "chat"
)
out = encode_messages(messages, **kwargs)
if continue_final_message and add_generation_prompt:
raise ValueError(
Expand Down
3 changes: 2 additions & 1 deletion mlx_lm/models/deepseek_v32.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class ModelArgs(BaseModelArgs):
rope_theta: float = 10000.0
rope_scaling: Dict = None
attention_bias: bool = False
indexer_rope_interleave: bool = False


class Indexer(nn.Module):
Expand All @@ -71,7 +72,7 @@ def __init__(self, args: ModelArgs):
self.rope = initialize_rope(
dims=args.qk_rope_head_dim,
base=args.rope_theta,
traditional=True,
traditional=args.indexer_rope_interleave,
Comment on lines -74 to +75

@pcuenca pcuenca Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning: we are flipping the default to False here.

However, I think the only subclass is currently glm_moe_dsa and the property does exist for GLM 5 models:

max_position_embeddings=args.max_position_embeddings,
scaling_config=args.rope_scaling,
)
Expand Down
1 change: 1 addition & 0 deletions mlx_lm/models/glm_moe_dsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class ModelArgs(BaseModelArgs):
attention_bias: bool
rope_scaling: Dict = None
rope_theta: Optional[float] = None
indexer_rope_interleave: bool = True

def __post_init__(self):
self.rope_scaling = self.rope_parameters
Expand Down
Loading