ValueError: not enough values to unpack (expected 4, got 3)

#6
by veilsidebr - opened

Hi there! Using the 7b instruct model, i used the code provided in model card, saved as main.py and when i run it, i keep receiving this error after 3-5 mins processing, any ideas of what may be wrong?

C:\Users\veilsidebr/.cache\huggingface\modules\transformers_modules\tiiuae\falcon-7b-instruct\b6 β”‚
β”‚ efaea5d78e4313145bda4d688675414a76fc22\modelling_RW.py:478 in _convert_to_rw_cache β”‚
β”‚ β”‚
β”‚ 475 β”‚ def _convert_to_rw_cache( β”‚
β”‚ 476 β”‚ β”‚ past_key_value: Tuple[Tuple[torch.Tensor, torch.Tensor]] β”‚
β”‚ 477 β”‚ ) -> Tuple[Tuple[torch.Tensor, torch.Tensor]]: β”‚
β”‚ ❱ 478 β”‚ β”‚ batch_size, num_heads, head_dim, seq_length = past_key_value[0][0].shape β”‚
β”‚ 479 β”‚ β”‚ batch_size_times_num_heads = batch_size * num_heads β”‚
β”‚ 480 β”‚ β”‚ # key: [batch_size, num_heads, head_dim, seq_length] -> [batch_size * num_heads β”‚
β”‚ 481 β”‚ β”‚ # value: [batch_size, num_heads, seq_length, head_dim] -> [batch_size * num_head β”‚
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: not enough values to unpack (expected 4, got 3)
PS C:\Models\Falcon-7B>

Try upgrading package from transformers to latest version
I upgraded transformers to 4.30.2 and this issues is resolved
P.S torch=2.0.1

Sign up or log in to comment