ChatGLM-6B icon indicating copy to clipboard operation
ChatGLM-6B copied to clipboard

The following operation failed in the TorchScript interpreter.

Open yangzhipeng1108 opened this issue 1 year ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

bash train.sh

Expected Behavior

No response

Steps To Reproduce

Traceback of TorchScript (most recent call last): File "/root/.cache/huggingface/modules/transformers_modules/chatglm-6b/modeling_chatglm.py", line 201, in cos, sin = F.embedding(position_id, cos.squeeze(1)).unsqueeze(2),
F.embedding(position_id, sin.squeeze(1)).unsqueeze(2) q, k = (q * cos) + (rotate_half(q) * sin), (k * cos) + (rotate_half(k) * sin) ~~~~~~~ <--- HERE return q, k RuntimeError: The size of tensor a (512) must match the size of tensor b (21) at non-singleton dimension 0

Environment

OS: Ubuntu 20.04
Python: 3.8
Transformers: 4.27.1
PyTorch: 1.12
CUDA Support: True

Anything else?

No response

yangzhipeng1108 avatar Apr 24 '23 06:04 yangzhipeng1108