Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
calpt committed Dec 16, 2023
1 parent d55b79b commit 6e79c7d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/adapters/models/llama/modeling_llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def forward(
) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
if "padding_mask" in kwargs:
warnings.warn(
"Passing `padding_mask` is deprecated and will be removed in v4.37. Please make sure use `attention_mask` instead.`"
"Passing `padding_mask` is deprecated and will be removed in v4.37. Please make sure use"
" `attention_mask` instead.`"
)

bsz, q_len, _ = hidden_states.size()
Expand Down Expand Up @@ -97,9 +98,9 @@ def forward(
if past_key_value is not None:
if self.layer_idx is None:
raise ValueError(
f"The cache structure has changed since version v4.36. If you are using {self.__class__.__name__} "
"for auto-regressive decoding with k/v caching, please make sure to initialize the attention class "
"with a layer index."
"The cache structure has changed since version v4.36. If you are using"
f" {self.__class__.__name__} for auto-regressive decoding with k/v caching, please make sure to"
" initialize the attention class with a layer index."
)
kv_seq_len += past_key_value.get_usable_length(kv_seq_len, self.layer_idx)
cos, sin = self.rotary_emb(value_states, seq_len=kv_seq_len)
Expand Down

0 comments on commit 6e79c7d

Please sign in to comment.