"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "738ecd17d869577d263eb1fba3fee0ab8ec5b5a2"
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): ...@@ -153,7 +153,14 @@ class BioGptAttention(nn.Module):
# get query proj # get query proj
query_states = self.q_proj(hidden_states) * self.scaling query_states = self.q_proj(hidden_states) * self.scaling
# get key, value proj # 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 # reuse k,v, cross_attentions
key_states = past_key_value[0] key_states = past_key_value[0]
value_states = past_key_value[1] 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