Error while summarizing

#61
by Harsh6519 - opened

While I pass large paragraph in input then getting below error :
So Is there any way to increase input size.?

Screenshot from 2023-11-02 15-00-10.png

Your input text is probably too long. You need to truncate it:

summary = summarizer(text, min_length=10, max_length=200, truncation=True)

I still receive the same error despite setting truncation to True and max_length to 200. Error message states that 'Asking to truncate to max_length but no maximum length is provided and the model has no predefined maximum length. Default to no truncation.'

but I clearly set max_length: summary = summarizer(text_to_summarize, min_length=10, max_length=200, truncation=True)

The maximum input length for bart is 1024 tokens. To not have the error, do the following:

summarizer.tokenizer.model_max_length = 1024

summarizer(long_text, max_new_tokens=10, truncation=True, min_length=1)

The max output length is also 1024

Sign up or log in to comment