Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError : indices should be either on cpu or on the same device as the indexed tensor (cpu) #240

Open
belle9217 opened this issue Jan 24, 2024 · 1 comment

Comments

@belle9217
Copy link

File "/slurmhome/qqq/.local/lib/python3.11/site-packages/transformers/models/llama/modeling_llama.py", line 333, in forward
^^^^^^^^^^^^^^^^^
File "/slurmhome/qqq/.local/lib/python3.11/site-packages/transformers/models/llama/modeling_llama.py", line 184, in apply_rotary_pos_emb
query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin, position_ids)
cos = cos[position_ids].unsqueeze(1) # [bs, 1, seq_len, dim]
~ ~ ~^ ^ ^^ ^ ^^ ^^ ^ ^ ^^ ^

@belle9217
Copy link
Author

how to resolve the bug?thanks for your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant