This throws the error:
ValueError: Unfeasible length constraints: the minimum length (56) is larger than the maximum length (45)
To Reproduce
Steps to reproduce the behavior:
start by importing pipeline
from transformers import pipeline
text = """Dear Amazon, last week I ordered an Optimus Prime action figure
from your online store in Germany. Unfortunately, when I opened the package,
I discovered to my horror that I had been sent an action figure of Megatron
instead! As a lifelong enemy of the Decepticons, I hope you can understand my
dilemma. To resolve the issue, I demand an exchange of Megatron for the
Optimus Prime figure I ordered. Enclosed are copies of my records concerning
this purchase. I expect to hear from you soon. Sincerely, Bumblebee."""
Information
The problem arises in chapter:
Describe the bug
summarizer = pipeline("summarization") outputs = summarizer(text, max_length=45, clean_up_tokenization_spaces=True) print(outputs[0]['summary_text'])
This throws the error:
ValueError: Unfeasible length constraints: the minimum length (56) is larger than the maximum length (45)
To Reproduce
Steps to reproduce the behavior:
from transformers import pipeline
text = """Dear Amazon, last week I ordered an Optimus Prime action figure from your online store in Germany. Unfortunately, when I opened the package, I discovered to my horror that I had been sent an action figure of Megatron instead! As a lifelong enemy of the Decepticons, I hope you can understand my dilemma. To resolve the issue, I demand an exchange of Megatron for the Optimus Prime figure I ordered. Enclosed are copies of my records concerning this purchase. I expect to hear from you soon. Sincerely, Bumblebee."""
summarizer = pipeline("summarization") outputs = summarizer(text, max_length=45, clean_up_tokenization_spaces=True) print(outputs[0]['summary_text'])
ValueError
complaining that min_length is greater than the max_length you have set.Expected behavior