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 cohere.py

Daniel Han739509e3a748
diff --git a/unsloth/models/cohere.py b/unsloth/models/cohere.py
index cbbebeec5ce..1610949f64b 100644
--- a/unsloth/models/cohere.py
+++ b/unsloth/models/cohere.py
@@ -68,7 +68,7 @@ pass
def CohereAttention_fast_forward(
self,
hidden_states: torch.Tensor,
- causal_mask: Optional[xformers.attn_bias.BlockDiagonalCausalMask] = None,
+ causal_mask: Optional[BlockDiagonalCausalMask] = None,
attention_mask: Optional[torch.Tensor] = None,
position_ids: Optional[torch.LongTensor] = None,
past_key_value: Optional[Tuple[torch.Tensor]] = None,
@@ -183,7 +183,7 @@ pass
def CohereDecoderLayer_fast_forward(
self,
hidden_states: torch.Tensor,
- causal_mask: Optional[xformers.attn_bias.BlockDiagonalCausalMask] = None,
+ causal_mask: Optional[BlockDiagonalCausalMask] = None,
attention_mask: Optional[torch.Tensor] = None,
position_ids: Optional[torch.LongTensor] = None,
past_key_value: Optional[Tuple[torch.Tensor]] = None,