huggingface / transformers

🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
https://huggingface.co/transformers
Apache License 2.0
133.17k stars 26.59k forks source link

Bertabs example: index_select(): Expected dtype int64 for index #8533

Closed TheTimKiely closed 3 years ago

TheTimKiely commented 3 years ago

Environment info

Who can help

@patil-suraj

Information

Following the example in the seq2seq/bertabs readme.md. I am getting this error:

File "/code/tools/transformers/examples/seq2seq/bertabs/modeling_bertabs.py", line 919, in _fast_translate_batch
    alive_seq = torch.cat([alive_seq.index_select(0, select_indices), topk_ids.view(-1, 1)], -1)
RuntimeError: index_select(): Expected dtype int64 for index

In a debugger, I see that the 'select_indices' parameter is a tensor of floats.

I don't understand the beam mechanism, so I don't know where to start troubleshooting this.

Any help would be great!

-Tim

LysandreJik commented 3 years ago

Hello! The bert_abs example is not maintained anymore, and should be moved to examples/contrib/legacy.

The recommended way of training sequence-to-sequence models is described in the examples/seq2seq/README.md file. What are you trying to do with bertabs, so that we may help you find what you need?

TheTimKiely commented 3 years ago

Hi! Thanks for your response. I'm just starting to experiment with abstractive text summarization. Is this something I should look for in the Hugging Face tools and samples? Thanks again, Tim

LysandreJik commented 3 years ago

I believe abstractive text summarization is implemented in the seq2seq examples, as the XSUM models were trained to do abstractive text summarization.

Have you taken a look at the summarization examples in https://github.com/huggingface/transformers/tree/master/examples/seq2seq?

@patil-suraj may also be of help.

TheTimKiely commented 3 years ago

Thanks again! I’ll take a look at the seq2seq examples.
-Tim

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale and been closed because it has not had recent activity. Thank you for your contributions.

If you think this still needs to be addressed please comment on this thread.