Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #104

Open
guanzy2012 opened this issue Jan 18, 2025 · 2 comments

Comments

@guanzy2012
Copy link

No description provided.

@bys0318
Copy link
Member

bys0318 commented Jan 23, 2025

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
Copy link
Member

bys0318 commented Jan 23, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants