starcoder icon indicating copy to clipboard operation
starcoder copied to clipboard

only small amount coming as output.

Open EngOMAR2030 opened this issue 2 years ago • 1 comments
trafficstars

I run the model and when running the model this message appears: Setting pad_token_id to eos_token_id:0 for open-end generation. Input length of input_ids is 21, but max_length is set to 20. This can lead to unexpected behavior. You should consider increasing max_new_tokens.

and the output is only small characters not so much of words like the demo of the model page in the huggingface website.

EngOMAR2030 avatar May 22 '23 10:05 EngOMAR2030

Can you share your code? As explained in the trace you should try to set the parameter max_new_tokens to be big enough for what you want to generate, for example model.generate(inputs, max_new_tokens=150). Another option is to use max_length. As a matter of fact, when you use generate without precising the value of the max_length argument, it is by default equal to 20. And that max_length parameter represents the length of the input prompt + max_new_tokens. So, if you want to generate something, you should choose max_length to be big enough considering the size of your prompt.

ArmelRandy avatar May 30 '23 10:05 ArmelRandy

Done that and worked.. thank you.

EngOMAR2030 avatar Jun 05 '23 13:06 EngOMAR2030