AttributeError: 'T5Config' object has no attribute 'output_scores'
## Environment info
<!-- You can run the command `transformers-cli env` and copy-and-paste its output below.
     Don't forget to fill out the missing fields in that output! -->

- `transformers` version:4.12.2

- Platform: Google collab
- Python version:
- PyTorch version (GPU?): Tesla K80
- Tensorflow version (GPU?):
- Using GPU in script?:yes
- Using distributed or parallel set-up in script?:

### Who can help
Text Generation: @patrickvonplaten @TevenLeScao
T5: @patrickvonplaten

## Information

Model I am using T5 base model in order to train in my custom dataset
`model=T5ForConditionalGeneration.from_pretrained(t5-base,return_dict=True)`

After training I want to predict answer  based on QC.

Here is the function which generates prediction of my trained model:
```
def generate_aswer(question,context):
  source_encoding=tokenizer(
    question,
    context,
    max_length=1000,
    padding='max_length',
    truncation='only_second',
    return_attention_mask=True,
    add_special_tokens=True,
    return_tensors='pt')

  generated_ids=model_up.model.generate(
      
      input_ids=source_encoding['input_ids'],
      attention_mask=source_encoding['attention_mask'],
      num_beams=1,
      max_length=400,
      repetition_penalty=2.5,
      length_penalty=1.0,
      early_stopping=True,
      use_cache=True)
  pred=[tokenizer.decode(generated_id,skip_special_tokens=True,clean_up_tokenization_spaces=True) for generated_id in generated_ids]
  return " ".join(pred)   
``` 
where model_up is my trained model.
when I am using question and context in order to predict answer function returns:

`AttributeError: 'T5Config' object has no attribute 'output_scores'`

I week ago this code worked 


@MariamDundua May I ask why you are using ```model_up.model.generate``` instead of just ```model_up.generate``` ?
It will be very helpful If you could share the colab link. 😄 <|||||>@Atharva-Phatak Here is the  link
[github](https://github.com/MariamDundua/Mariam-Dundua/blob/master/t5_base_training_on_QA.ipynb)
<|||||>I saw you are using PL. This might help : https://pytorch-lightning.readthedocs.io/en/latest/common/weights_loading.html<|||||>This solves the problem
```
from transformers import T5Config
config=T5Config.from_pretrained('t5-base')
model=T5ForConditionalGeneration.from_pretrained(model_t5,config=config)
```