problems of IndexError
Traceback (most recent call last):
File "XXX\pegasus.py", line 25, in
summary_ids = model.generate(inputs["input_ids"])
File "C:\Users\dell\anaconda3\lib\site-packages\torch\utils_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
File "C:\Users\dell\anaconda3\lib\site-packages\transformers\generation\utils.py", line 1745, in generate
model_kwargs = self._prepare_encoder_decoder_kwargs_for_generation(
File "C:\Users\dell\anaconda3\lib\site-packages\transformers\generation\utils.py", line 549, in _prepare_encoder_decoder_kwargs_for_generation
model_kwargs["encoder_outputs"]: ModelOutput = encoder(**encoder_kwargs)
File "C:\Users\dell\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\dell\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\dell\anaconda3\lib\site-packages\transformers\models\pegasus\modeling_pegasus.py", line 740, in forward
inputs_embeds = self.embed_tokens(input_ids) * self.embed_scale
File "C:\Users\dell\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\dell\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\dell\anaconda3\lib\site-packages\torch\nn\modules\sparse.py", line 164, in forward
return F.embedding(
File "C:\Users\dell\anaconda3\lib\site-packages\torch\nn\functional.py", line 2267, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
IndexError: index out of range in self
I use sample in model card, but got mistakes.
what happened in my code?