RuntimeError: The expanded size of the tensor (20) must match the existing size (101) at non-singleton dimension 0.  Target sizes: [20].  Tensor sizes: [101] 
My goal is to be able to pass 100 (or 300) tokens (or some other number) as input and get back at most 16 additional tokens (or some other number I can control).


Code is strait forward:

```
vocab_size = model.config.vocab_size
input_ids = torch.randint(vocab_size, (1, 300), dtype=torch.long, device=device)
model.generate(
            input_ids,
            language_ids=language_ids,
            do_sample=False,
            num_beams=num_beams,
            max_length=max_length,
            repetition_penalty=1.6,
            pad_token_id=tokenizer.eos_token_id,
            num_return_sequences=num_sequences
        )
```

Can you elaborate on the semantics of what "max_length" refers to?

Per the documentation:

https://huggingface.co/transformers/main_classes/configuration.html#transformers.PretrainedConfig

**Parameters for sequence generation**

> max_length (int, optional, defaults to 20) – Maximum length that will be used by default in the generate method of the model.

If I am doing something wrong, please point me to how to control the behavior in the correct way 😄 

Side note:
I also played with the model config (so many tests and various messages):

```
model.config.max_length = 16 # other numbers were tried as well
```


Depending on the setup I could also get a message like this (same `generate` call as above):

> Input length of input_ids is 300, but ``max_length`` is set to 20.This can lead to unexpected behavior. You should consider increasing ``config.max_length`` or ``max_length``
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/master/CONTRIBUTING.md) are likely to be ignored.