You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ValueError: Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' 'truncation=True' to have batched tensors with the same length. Perhaps your features (input_ids in this case) have excessive nesting (inputs type list where type int is expected).
#16
Open
youssefabdelm opened this issue
Nov 1, 2022
· 0 comments
importtorchfromlm_scorer.models.autoimportAutoLMScorerasLMScorer# Load model to cpu or cudadevice="cuda:0"iftorch.cuda.is_available() else"cpu"batch_size=100scorer=LMScorer.from_pretrained("distilgpt2", device=device, batch_size=batch_size)
Hi! Thanks for making this amazing package.
When I do:
And then:
(Or any sentences of different length while trying to batch, I get this error):
Would love any help whatsoever!
The text was updated successfully, but these errors were encountered: