How to change max_length of a fine tuned model

Hello Everyone,
I trained and shared a custom model based on gpt2 and now in config.json file of my model in the Model Hub I have the max_length as 50. I don’t remember passing that number as a training argument or such. However I want to use the whole capability of gpt-2 model and generate texts of length 1024 tokens. How can I update my model on Model Hub so that it’s possible to generate longer outputs using a pipeline?
Here’s the config file of my model : config.json · YusufSahin99/IFIS_ZORK_AI_FANTASY at main

Any help would be appreciated :slight_smile:

This number is just a default for when you use the model in a text-generation pipeline, which can be overridden by passing a new max_length in a call.

1 Like

Can someone please tell me what is the max_length & min_length values in summazier
summary_text = summarizer(text, max_length=?, min_length=?)[0][‘summary_text’]

Thanks

Is it the case the max_length can’t be longer than the model’s sequence length? I ask because I’ve seen examples of setting max_length=10000 for generating long texts, but as soon as I set my max_length greater than my model’s sequence length it fails with IndexError: index out of range in self. I expected the pipeline to truncate and re-use the context, even if it was generating beyond the model’s sequence length… no?
The backtrace points to my model.generate() line. so I’m assuming it’s to do with the max_length setting.