T5 for summarization: pipeline x T5ForConditionalGeneration different results
I've been doing experiments with text summarization and got some different results between pipeline and T5ForConditionalGeneration.

First I use the model.generate() to generate the resume. It runs very fast (even on CPU) and give poors results.

Second I use the pipeline, passing the same model I build on the first step. This runs slower and give a very good results.

Third, I re-run the first model.generate(). Now, the the model runs slower and produces the same result as pipeline.

I did a colab so that you can check.

I'm loosing any point in using the model x pipeline?

https://colab.research.google.com/drive/15HOerw3mYVCsjedW_dVGeyRX5cYWiNvS
Hi @renatoviolin,

the T5 pipeline uses special input arguments for the `generate()` function that have been shown to work well for summarization. If you take a look at `task_specific_params` and under `summarization` in T5's config: https://s3.amazonaws.com/models.huggingface.co/bert/t5-base-config.json. You can see the `generate()` arguments that are used for pipeline.
<|||||>Hi @patrickvonplaten 

Thanks for your attention. Now I got the point where I'm doing wrong.
But the most strange thing that happened is that in third step, after the pipeline was executed, the 
model.generate() produces similar results (and take long to run) as the pipeline.
At first glance, given the poor results and how quickly it runs, it seemed to me that the weights were not loaded.<|||||>I think it's probably because beam search is deactivated, no length penalties, no repeat penalties and a very short max length is used 