How to use the method model.generate() correctly?
### System Info

- `transformers` version: 4.19.4
- Platform: Linux-4.9.93-010.ali3000.alios7.x86_64-x86_64-with-redhat-7.2-Paladin
- Python version: 3.7.11
- Huggingface_hub version: 0.7.0
- PyTorch version (GPU?): 1.12.1+cu113 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed

### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [X] My own task or dataset (give details below)

### Reproduction

## This is my code
self.decoder.generate(inputs=A, do_sample=True,
                                                 max_length=80, min_length=1,
                                                 top_k=50, top_p=0.95)

## self.decoder here is the BART model and A here is the input_features not the input_ids.

## The official document says that for the model of the encoder-decoder architecture, the generate method can input input_features, but an error occurs. According to the error log, input_features input is not supported, and only input_ids can be used.

## error log: RuntimeError: Expected tensor for argument #1 'indices' to have one of the following scalar types: Long, Int; but got torch.FloatTensor instead (while checking arguments for embedding)

## I want to know whether my usage is wrong or there is a bug in the source code

### Expected behavior

I hope my code will return output_ids
cc @gante <|||||>@zt991211, thanks for raising an issue! 

Could you provide a more detailed snippet which is reproducible i.e. can be directly copied and run as well as a full traceback of the error encountered? <|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.