Gemma inference fix
This commit is contained in:
parent
3dbf8ff9c5
commit
b5200a33f1
2 changed files with 7 additions and 2 deletions
|
|
@ -36,7 +36,7 @@ huggingface = [
|
|||
"tyro",
|
||||
"transformers>=4.38.2",
|
||||
"datasets>=2.16.0",
|
||||
"sentencepiece",
|
||||
"sentencepiece>=0.2.0",
|
||||
"tqdm",
|
||||
"psutil",
|
||||
"wheel>=0.42.0",
|
||||
|
|
|
|||
|
|
@ -145,7 +145,12 @@ def GemmaModel_fast_forward_inference(
|
|||
bsz, q_len, hd = hidden_states.shape
|
||||
seq_len = past_key_values[0][0].shape[-2]
|
||||
if bsz != 1:
|
||||
attention_mask = _prepare_4d_causal_attention_mask(attention_mask, (bsz, q_len), hidden_states, seq_len,)
|
||||
attention_mask = _prepare_4d_causal_attention_mask_for_sdpa(
|
||||
attention_mask,
|
||||
(bsz, q_len),
|
||||
hidden_states,
|
||||
seq_len,
|
||||
)
|
||||
pass
|
||||
|
||||
next_decoder_cache = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue