From 8e9d9c38b1c4dae4dbd4608dfebb4aa250bbed13 Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Wed, 7 Feb 2024 01:48:31 +1100 Subject: [PATCH] SWA inference --- unsloth/__init__.py | 1 - unsloth/models/llama.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/unsloth/__init__.py b/unsloth/__init__.py index c3baac21d4..66c10e28e7 100644 --- a/unsloth/__init__.py +++ b/unsloth/__init__.py @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "2024.1" import os import warnings import importlib diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index 5b5b74e0ac..266d9f2f89 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -184,7 +184,7 @@ def LlamaAttention_fast_forward_inference( # Grouped query attention if n_groups != 1: - _, _, cached_len, _ = Kn.shape + _, _, cached_len, _ = Knn.shape Knn = Knn[:, :, None, :, :].expand(bsz, n_kv_heads, n_groups, cached_len, head_dim) Vnn = Vnn[:, :, None, :, :].expand(bsz, n_kv_heads, n_groups, cached_len, head_dim) Knn = Knn.reshape(bsz, n_heads, cached_len, head_dim)