Closed SeitaroShinagawa closed 1 month ago
It would be great if you could submit a PR to fix it.
The problem may because you used pytorch backend and it return bfloat16 tensor (turbomind backend will output float32 tensor). And I think it would be better to change this line to _logits = _logits.float().cpu()
Thank you for your suggestion. I followed it and created the PR.
Checklist
Describe the bug
I got an error message of TypeError.
Reproduction
I executed the following script in ipython. Note: This is from "An example to cauculate logits & ppl"
Environment
Error traceback
I confirmed this trouble was fixed by replacing
loss_avg = loss_avg.cpu().numpy()
withloss_avg = loss_avg.cpu().float().numpy()
I think it's just a small fix. I can create a PR if it would be preferable for the maintainers.