I am using a Pegasus model (
google/pegasus-multi_news) to generate summaries from new articles and trying to get short summaries (20-50 words).
model_name = 'google/pegasus-multi_news' model = PegasusForConditionalGeneration.from_pretrained(model_name) model.generate(**batch, **kwargs)
I tried adjusting the
early_stopping arguments but they don’t change the output for me.
max_new_tokens does give me a shorter output but it is essentially truncated text so not that useful.
Is there a way to force/strongly guide the model to generate a summary of roughly the desired length?