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

[BUG/Help] 当前代码中的 get_position_ids 疑似和paper中的描述不一致

Open xingchensong opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

当前代码中的 get_position_ids 疑似和paper中的描述不一致。

image

https://huggingface.co/THUDM/chatglm-6b/blob/main/modeling_chatglm.py#L692-L713

假设输入是 ['今', '天', 'gMASK', 'bos'], 那么按照上述代码得到的2d position 为:

- ‘今’ ‘天’ ‘gMASK’ ‘bos’
standard position 0 1 2 2
block position 0 0 0 1

然而,按照paper里给的例子,真实的position应该为

image

- ‘今’ ‘天’ ‘gMASK’ ‘bos’
standard position 1 2 3 3
block position 0 0 0 1

Expected Behavior

见上述描述

Steps To Reproduce

见上述描述

Environment

- OS:
- Python:
- Transformers:
- PyTorch:
- CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) :

Anything else?

No response

xingchensong avatar Jun 19 '23 13:06 xingchensong

@duzx16 请问可以解答一下疑惑吗?

xingchensong avatar Jun 19 '23 13:06 xingchensong