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

报错 #48

Open
fxb392 opened this issue Jul 12, 2023 · 0 comments
Open

报错 #48

fxb392 opened this issue Jul 12, 2023 · 0 comments

Comments

@fxb392
Copy link

fxb392 commented Jul 12, 2023

return {'input_ids': torch.tensor(input_ids).long(),
'attention_mask': attention_mask,
'labels': torch.stack(labels),
'position_ids':torch.stack(position_ids)}
这里为什么有torch.tensor()和torch.stack()呢?
不写成torch.stack()有时会报ValueError: expected sequence of length 50 at dim 1 (got 49)这个错,可以解答一下吗?

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