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

RuntimeError: probability tensor contains either inf, nan or element < 0 #18

Open
chunhualiao opened this issue Aug 22, 2023 · 0 comments

Comments

@chunhualiao
Copy link

After 2.4 Run Fine-Tuning Loop, I got the following error when running 2.6 Evaluate Performance (USMLE):

Traceback (most recent call last):
File "llama2.py", line 450, in
accuracy = evaluate_model(model, tokenizer, dataset,"")
File "llama2.py", line 284, in evaluate_model
output = model.generate(input_ids, num_beams=4)
File ". pytorch/1.13.1/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File ".local/unknown/pytorch1.13.1/lib/python3.9/site-packages/transformers/generation/utils.py", line 1665, in generate
return self.beam_sample(
File ".local/unknown/pytorch1.13.1/lib/python3.9/site-packages/transformers/generation/utils.py", line 3309, in beam_sample
next_tokens = torch.multinomial(probs, num_samples=2 * num_beams)
RuntimeError: probability tensor contains either inf, nan or element < 0

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