I am using flant5-xxl to generate a sequence as follows
tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-xxl",cache_dir="/home/racball/flan-t5-xxl--tokeniser")
model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-xxl",cache_dir="/home/racball/models--flan-t5-xxl",device_map="balanced_low_0")
generated = tokenizer.decode(model.generate(tokenizer('',return_tensors='pt').input_ids,min_new_tokens=30)[0])
gives the result '<pad>. Images via Wikipedia, Wikimedia Commons, wikimedia.org, Wiki'
However, len(tokenizer.encode(generated)) = 22
which is less than the min_new_tokens
I passed as the function argument.
Shouldnt it generate a sequence of token length of atleast 30 according to the documentation here? What am I doing wrong?