From 57f41da13b10d909b85b7c335050e14fdb5b0d9b Mon Sep 17 00:00:00 2001 From: Luka Zakrajšek Date: Sat, 4 Jan 2025 16:11:20 +0100 Subject: Fix mistral attention on Metal (#2699) Co-authored-by: Luka Zakrajsek --- candle-transformers/src/models/mistral.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'candle-transformers') diff --git a/candle-transformers/src/models/mistral.rs b/candle-transformers/src/models/mistral.rs index f927f88b..8df73d61 100644 --- a/candle-transformers/src/models/mistral.rs +++ b/candle-transformers/src/models/mistral.rs @@ -262,7 +262,8 @@ impl Attention { .contiguous()?; let value_states = value_states .reshape((b_sz, q_len, self.num_kv_heads, self.head_dim))? - .transpose(1, 2)?; + .transpose(1, 2)? + .contiguous()?; let (query_states, key_states) = self.rotary_emb -- cgit v1.2.3