Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Update mistral.py

Daniel Han125b3727ffae
diff --git a/unsloth/models/mistral.py b/unsloth/models/mistral.py
index d7376d95218..b2531056a09 100644
--- a/unsloth/models/mistral.py
+++ b/unsloth/models/mistral.py
@@ -161,7 +161,7 @@ def MistralAttention_fast_forward(
A = A.transpose(1, 2).contiguous()
pass
- attn_output = A.reshape(bsz, q_len, self.hidden_size)
+ attn_output = A.reshape(bsz, q_len, n_heads*head_dim)
attn_output = self.apply_o(self, attn_output)
attn_weights = None
return attn_output, attn_weights, past_key_value