ohmeow / blurr

A library that integrates huggingface transformers with the world of fastai, giving fastai devs everything they need to train, evaluate, and deploy transformer specific models.
https://ohmeow.github.io/blurr
Apache License 2.0
289 stars 34 forks source link

summarisation output length #76

Open LukasFides opened 2 years ago

LukasFides commented 2 years ago

Thank you for updating the framework. I trained my model successfully with custom data but wanted to ask how to extend the length of the individual summarisation output. Currently my outputs are very short (often even cut off sentences).

ohmeow commented 2 years ago

Take a look here: https://ohmeow.github.io/blurr/text-modeling-seq2seq-summarization.html

In particular, see how text_gen_kwargs is defined. There is a max_length parameters used during generation that controls the maximum number of tokens generated ... that is likely what you want to change.

You can also pass in text-generation specific arguments as kwargs when you call Learner.blurr_summarize. If you don't it will use the text_gen_kwargs you specified when constructing your DataBlock.