"vscode:/vscode.git/clone" did not exist on "b4fd49b6c54ac34d45cc656f2872b5f392029590"
Unverified Commit 6a707cf5 authored by Sylvain Gugger's avatar Sylvain Gugger
Browse files

Repo consistency

parent 97a51b0c
......@@ -153,7 +153,14 @@ class BioGptAttention(nn.Module):
# get query proj
query_states = self.q_proj(hidden_states) * self.scaling
# get key, value proj
if is_cross_attention and past_key_value is not None:
# `past_key_value[0].shape[2] == key_value_states.shape[1]`
# is checking that the `sequence_length` of the `past_key_value` is the same as
# the provided `key_value_states` to support prefix tuning
if (
is_cross_attention
and past_key_value is not None
and past_key_value[0].shape[2] == key_value_states.shape[1]
):
# reuse k,v, cross_attentions
key_states = past_key_value[0]
value_states = past_key_value[1]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment