File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -207,8 +207,8 @@ def _validate_update_cache_params(
207207 1
208208 ), f"Start position { start_pos } must be less than sequence length { cache .size (1 )} "
209209
210- torch ._check ((start_pos + seq_len ) < cache .size (1 ))
211- assert (start_pos + seq_len ) < cache .size (
210+ torch ._check ((start_pos + seq_len ) <= cache .size (1 ))
211+ assert (start_pos + seq_len ) <= cache .size (
212212 1
213213 ), f"Start position + length = { start_pos + seq_len } must be less than sequence length { cache .size (1 )} "
214214
Original file line number Diff line number Diff line change @@ -142,7 +142,8 @@ def __init__(
142142 {1 : torch .export .Dim ("token_dim" , max = self .max_seq_len - 1 )},
143143 )
144144 else :
145- # Two input arguments: tokens and input_pos but input_pos is static shape
145+ # Two input arguments: tokens and input_pos but input_pos is static shape.
146+
146147 self .dynamic_shapes = (
147148 {1 : torch .export .Dim ("token_dim" , max = self .max_seq_len )},
148149 {"input_pos" : {0 : 1 }},
You can’t perform that action at this time.
0 commit comments