Repository navigation
Conversation
Signed-off-by: Stefan Wang <1fannnw@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
When an OpenAI-compatible endpoint rejects an MT-bench request for exceeding its context limit, the benchmark retries the same request and can write an error placeholder as a judgment. This change makes the OpenAI and Azure completion helpers raise invalid-request errors immediately, and it keeps retrying rate limits. Only the OpenAI helper is reached from the MT-bench scripts. The cluster summarizer is the only caller of the Azure helper.
The score of 7.42 in the issue is not established by this reproduction. The issue does not say whether answer generation or judging hit the limit, and the summary leaves out judgments that failed.
Related issue number (if applicable)
Relates to #3279
Checks
format.sh completed Black without edits to the changed files but exited 30 on repository-wide lint findings, including existing errors in model_adapter.py and controller.py. It reported nothing in the files this change touches.
Testing done
The reproducer uses the real OpenAI 0.28.1 SDK against a local HTTP server that returns a context-limit error. It uses two retries and no delay to keep the run short. The captured runs used Python 3.12.14 on macOS, and the warnings printed at import time are omitted below. Save the source below as repro_context_limit.py outside the checkout, then set up the environment:
Run the same two commands from a checkout of each revision. The first drives the MT-bench judge through the OpenAI helper. The second calls the Azure helper directly, because no MT-bench script reaches it.
Before, at 587d5cf, the judge retries and stores an error placeholder, and the Azure helper retries and returns one:
After, at f8ad8e6, both raise on the first request and the judgment file is never written:
The Python package workflow, including the new test step, passed at this head on my fork, on Ubuntu 26.04 with Python 3.10.22: https://github.com/1fanwang/FastChat/actions/runs/43093389164.
Reproducer source: repro_context_limit.py