The latest version of transformers (4.52.x) ignores the max length parameter. Update the code to handle this.