Update gemma.py
This commit is contained in:
parent
fdab3d618f
commit
d0a7dcec1d
1 changed files with 2 additions and 1 deletions
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
from .llama import *
|
||||
from ._utils import __version__
|
||||
import math
|
||||
|
||||
try:
|
||||
from transformers.models.gemma.modeling_gemma import (
|
||||
|
|
@ -256,7 +257,7 @@ class GemmaFixedRotaryEmbedding(torch.nn.Module):
|
|||
def extend_rope_embedding(self, x, seq_len):
|
||||
if seq_len <= self.current_rope_size: return
|
||||
# Iteratively grow by increments of 8192
|
||||
self.current_rope_size = int(round(seq_len / 8192)) * 8192
|
||||
self.current_rope_size = math.ceil(seq_len / 8192) * 8192
|
||||
self._set_cos_sin_cache(self.current_rope_size, device = "cuda:0", dtype = x.dtype)
|
||||
pass
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue