

TITLE
Empty Conversation Responses

COMMENTS
15

REACTIONS
+1: 0
-1: 0
laugh: 0
hooray: 0
heart: 0
rocket: 0
eyes: 0

BODY
## Environment info
Mac OS 10.14

My work is in rust, and I have an issue open in guillaume-be/rust-bert#87 however the authour of the repo asked that I also open it here to get HugginFace's opinion as it pertains to code that matches the intention of that in this repo.
     
- `transformers` version: rust-bert 0.10.0
- Platform: Mac OS
- PyTorch version (GPU?): No
- Tensorflow version (GPU?): No
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: Yes

### Who can help
 TextGeneration: @TevenLeScao  (This is in how min_ and max_length are treated during text generation of the conversation model)

## Information

Model I am using: DialgoGPT with the Conversation Moel

The problem arises when using:
* [x] the official example scripts: (give details below)
* [x] my own modified scripts: (give details below)

The problem occurs in the offical example of the rust and the owner of the the rust code assures me that there is exact same behaviour in this code too

The tasks I am working on is:
* [x] my own task or dataset: (give details below)

I am making a small chatbot, I have my own fine tuned model but the same behaviour is obseved with the stock DiagloGPT model

## To reproduce

Steps to reproduce the behavior:

1. Create a conversation model with `min_length` set
2. Talk with the conversation for about 10-12 responses
3. Responses will be zero length despite min_length begin set



## Expected behavior

Min length to be upheld during conversation

## Details

The root cause of this is how cur_len and min/max_len are handled in the code

https://github.com/huggingface/transformers/blob/15a189049e01fbd3bef902848a09f58a5f006c37/src/transformers/generation_utils.py#L86-L88

https://github.com/huggingface/transformers/blob/15a189049e01fbd3bef902848a09f58a5f006c37/src/transformers/generation_utils.py#L533

The cur_len is initalised with the length of current input which contains all previous dialogue with the bot as context

https://github.com/huggingface/transformers/blob/15a189049e01fbd3bef902848a09f58a5f006c37/src/transformers/generation_utils.py#L451

This means that min_length of the new utterence from the bot is already satisfied. It also means that max_length can be exceeded if a long conversation is held.

cur_len should perhaps be initialised differently in the ConverstaionModel