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

Daniel Han-Chen0e0e03c239cb
diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py
index a3a91ab33dd..e4b5118e629 100644
--- a/unsloth/models/llama.py
+++ b/unsloth/models/llama.py
@@ -15,8 +15,8 @@
import torch
from typing import Optional, Tuple, List, Union
from torch.nn.functional import scaled_dot_product_attention
+from transformers.modeling_attn_mask_utils import _prepare_4d_causal_attention_mask
from transformers.models.llama.modeling_llama import (
- _prepare_4d_causal_attention_mask,
logger,
BaseModelOutputWithPast,
CausalLMOutputWithPast,