We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 Traceback (most recent call last) in 93 TOKENIZER, MODEL = load_models(MODEL_NAME) 94 ---> 95 generate(TOKENIZER, MODEL, SENTENCES, LABEL, DEVICE)
in generate(tokenizer, model, sentences, label, device) 47 48 next_token_id = choose_from_top_k_top_n(softmax_logits.to('cpu').numpy()) #top-k-top-n sampling ---> 49 cur_ids = torch.cat([cur_ids, torch.ones((1,1)).long().to(device) * next_token_id], dim = 1) 50 51 if next_token_id in tokenizer.encode('<|endoftext|>'):
RuntimeError: All input tensors must be on the same device. Received cpu and cuda:0
The text was updated successfully, but these errors were encountered:
How did you solve it.thank you
Sorry, something went wrong.
No branches or pull requests
RuntimeError Traceback (most recent call last)
in
93 TOKENIZER, MODEL = load_models(MODEL_NAME)
94
---> 95 generate(TOKENIZER, MODEL, SENTENCES, LABEL, DEVICE)
in generate(tokenizer, model, sentences, label, device)
47
48 next_token_id = choose_from_top_k_top_n(softmax_logits.to('cpu').numpy()) #top-k-top-n sampling
---> 49 cur_ids = torch.cat([cur_ids, torch.ones((1,1)).long().to(device) * next_token_id], dim = 1)
50
51 if next_token_id in tokenizer.encode('<|endoftext|>'):
RuntimeError: All input tensors must be on the same device. Received cpu and cuda:0
The text was updated successfully, but these errors were encountered: