LongBench
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
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.
We take care of this potential issue in our code: https://github.com/THUDM/LongBench/blob/main/pred.py#L23