I have set the max length as follows:
model_name = "sagard21/python-code-explainer" tokenizer = AutoTokenizer.from_pretrained(model_name, padding=True, max_length=50) model = AutoModelForSeq2SeqLM.from_pretrained(model_name, max_length=50) config = AutoConfig.from_pretrained(model_name) config.task_specific_params['summarization']['max_length']=50 print(config) pipe = pipeline("summarization", model=model_name, config=config, tokenizer=tokenizer)
Yet I am still getting this error:
Your max_length is set to 200, but your input_length is only 80. Since this is a summarization task, where outputs shorter than the input are typically wanted, you might consider decreasing max_length manually, e.g. summarizer(‘…’, max_length=40)
What am i doing wrong?