LongBench icon indicating copy to clipboard operation
LongBench copied to clipboard

Error code: 400 - {'object': 'error', 'message': "This model's maximum context length is 131072 tokens. However, you requested 351430 tokens. Please reduce the length of the messages or completion.", 'type': 'BadRequestError', 'param': None, 'code': 400

Open guanzy2012 opened this issue 11 months ago • 2 comments

guanzy2012 avatar Jan 18 '25 03:01 guanzy2012

Hey, does this error happen during testing OpenAI model? You need to first truncate the sequence using tiktoken to less than 131072 tokens and then call the model on the truncated input.

bys0318 avatar Jan 23 '25 05:01 bys0318

We take care of this potential issue in our code: https://github.com/THUDM/LongBench/blob/main/pred.py#L23

bys0318 avatar Jan 23 '25 05:01 bys0318