From 2605ece8a6a08f5a1eceb8f56cf78ccd7670e1b5 Mon Sep 17 00:00:00 2001 From: lucidrains Date: Fri, 5 May 2023 14:53:47 -0700 Subject: [PATCH] fix bug with xpos, thanks to @andersonbcdefg --- rotary_embedding_torch/rotary_embedding_torch.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rotary_embedding_torch/rotary_embedding_torch.py b/rotary_embedding_torch/rotary_embedding_torch.py index c89cf80..2b1d965 100644 --- a/rotary_embedding_torch/rotary_embedding_torch.py +++ b/rotary_embedding_torch/rotary_embedding_torch.py @@ -122,7 +122,7 @@ def get_scale(self, t, cache_key = None): scale = 1. if self.use_xpos: - power = t - (len(t) // 2) / self.scale_base + power = (t - len(t) // 2) / self.scale_base scale = self.scale ** rearrange(power, 'n -> n 1') scale = torch.cat((scale, scale), dim = -1) diff --git a/setup.py b/setup.py index e7f2f03..4292aba 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name = 'rotary-embedding-torch', packages = find_packages(), - version = '0.2.2', + version = '0.2.3', license='MIT', description = 'Rotary Embedding - Pytorch', long_description_content_type = 'text/markdown',