Skip to content

Commit 3575636

Browse files
committed
rotary embed in loop
1 parent fc5974d commit 3575636

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

keras_hub/src/models/smollm3/smollm3_causal_lm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ def call_with_cache(
7070
x = self.backbone.token_embedding(token_ids)
7171

7272
# Each decoder layer has a cache; we update them separately.
73-
position_embeddings = self.backbone.rotary_embedding(x, start_index=cache_update_index)
73+
7474
updated_cache = []
7575
for i in range(self.backbone.num_layers):
76+
position_embeddings = self.backbone.rotary_embedding(x, start_index=cache_update_index)
7677
current_cache = cache[:, i, ...]
7778
x, next_cache = self.backbone.transformer_layers[i](
7879
x,

0 commit comments

Comments
 (0)