Skip to content

Commit fc5974d

Browse files
committed
log cache_update_index
1 parent de79b8d commit fc5974d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

keras_hub/src/models/smollm3/smollm3_backbone.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,9 @@ def __init__(
124124
)
125125

126126
hidden_states = self.token_embedding(token_id_input)
127-
127+
position_embeddings = self.rotary_embedding(hidden_states, start_index=start_index)
128128

129129
for decoder_layer in self.transformer_layers[:num_layers]:
130-
position_embeddings = self.rotary_embedding(hidden_states, start_index=start_index)
131130
hidden_states = decoder_layer(
132131
hidden_states,
133132
position_embeddings=position_embeddings,

keras_hub/src/models/smollm3/smollm3_layers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ def call(
601601
seq_len = ops.shape(x)[1]
602602
positions = ops.arange(seq_len, dtype="float32")
603603
positions = positions + ops.cast(start_index, dtype="float32")
604+
print(start_index)
604605

605606
inv_freq_expanded = ops.broadcast_to(
606607
inv_freq_expanded, (batch_size, ops.shape(self.inv_freq)[0], 1)

0 commit comments

Comments
 (0)