From f28eeaad5e3490b26141b436184314e0dcd96599 Mon Sep 17 00:00:00 2001 From: shunxing12345 <747777271@qq.com> Date: Tue, 14 Jan 2025 15:18:33 +0800 Subject: [PATCH] fix Signed-off-by: shunxing12345 <747777271@qq.com> --- src/transformers/models/telechat2/modeling_telechat2.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/transformers/models/telechat2/modeling_telechat2.py b/src/transformers/models/telechat2/modeling_telechat2.py index 42f4bf35675b4a..e4290d9931237e 100644 --- a/src/transformers/models/telechat2/modeling_telechat2.py +++ b/src/transformers/models/telechat2/modeling_telechat2.py @@ -373,6 +373,7 @@ def _dynamic_frequency_update(self, position_ids, device): if seq_len < self.original_max_seq_len and self.max_seq_len_cached > self.original_max_seq_len: # reset # This .to() is needed if the model has been moved to a device after being initialized (because # the buffer is automatically moved, but not the original copy) + self.original_inv_freq = self.original_inv_freq.to(device) self.register_buffer("inv_freq", self.original_inv_freq, persistent=False) self.max_seq_len_cached = self.original_max_seq_len