From 152e988d3c07a5ae0387a17054199693ce85b376 Mon Sep 17 00:00:00 2001 From: Sunny Liu Date: Wed, 22 Jan 2025 21:02:26 -0500 Subject: [PATCH] llama sdpa patching WIP - static class function import --- src/axolotl/monkeypatch/llama_patch_multipack.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/axolotl/monkeypatch/llama_patch_multipack.py b/src/axolotl/monkeypatch/llama_patch_multipack.py index 5a8112ac1..e4729a45f 100644 --- a/src/axolotl/monkeypatch/llama_patch_multipack.py +++ b/src/axolotl/monkeypatch/llama_patch_multipack.py @@ -29,11 +29,11 @@ def hijack_llama_prepare_4d_mask(): @staticmethod def llama_patched_prepare_4d_causal_attention_mask_with_cache_position( - attention_mask: Optional[torch.Tensor], *args, **kwargs + attention_mask: Optional[torch.Tensor], *args ): dtype = torch.bfloat16 if is_torch_bf16_gpu_available() else torch.float32 return LlamaModel._prepare_4d_causal_attention_mask_with_cache_position( - mask_2d_to_4d(attention_mask, dtype=dtype), *args, **kwargs + mask_2d_to_4d(attention_mask, dtype=dtype), *args ) LlamaModel._prepare_4d_causal_attention_mask_with_cache_position = ( # pylint: disable=protected-access