I am trying to convert baichuan2-megatron to hf. When reading the code, i can not understand this part
def permute(x):
if revert:
return x.view(head_dim//2, 2, dim).transpose(0, 1).reshape(head_dim, dim)
return x.view(2, head_dim//2, dim).transpose(0, 1).reshape(head_dim, dim)
Why head_dim//2?
Really appreciate it if someone can explain this.
I am trying to convert baichuan2-megatron to hf. When reading the code, i can not understand this part
Why head_dim//2?
Really appreciate it if someone can explain this.