[RWKV] Inference memory leak unless use_cache=False is specified
### System Info

- `transformers` version: 4.29.2
- Platform: macOS-13.3.1-arm64-arm-64bit
- Python version: 3.8.16
- Huggingface_hub version: 0.14.1
- Safetensors version: not installed
- PyTorch version (GPU?): 2.0.1 (False)
- Tensorflow version (GPU?): 2.13.0-rc0 (True)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No


### Who can help?

@sgugger 

### Information

- [X] 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

Memory usage rapidly climbs when running a stripped-down version of the RWKV overview example [here](https://huggingface.co/docs/transformers/model_doc/rwkv#overview), in a loop:

```python
from transformers import AutoTokenizer, RwkvModel

model = RwkvModel.from_pretrained("sgugger/rwkv-430M-pile")
tokenizer = AutoTokenizer.from_pretrained("sgugger/rwkv-430M-pile")


for _ in range(1000):
        inputs = tokenizer("This is an example.", return_tensors="pt")
        # Feed everything to the model
        model(inputs["input_ids"]).  #  <--- memory leak 
```

Passing `use_cache=False` to the forward step solves this, though it's not clear why, since the cached state 'should' be bounded to 5 entries. 



### Expected behavior

Stable memory usage
This is because you are not executing your forward pass under a `torch.no_grad`, so the gradient history blows up via the state of the outputs. Either do this or manually detach the states to avoid this memory use. <|||||>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.