Fix inspect-ai GenerateConfig field names in lighteval eval - #1331
Open
harshasiddartha wants to merge 1 commit into
Open
Fix inspect-ai GenerateConfig field names in lighteval eval#1331harshasiddartha wants to merge 1 commit into
lighteval eval#1331harshasiddartha wants to merge 1 commit into
Conversation
`lighteval eval` crashes at startup on a fresh install for every model and
task:
ValidationError: 1 validation error for GenerateConfig
Value error, Unknown GenerateConfig field(s): frequence_penalty,
log_probs, response_format.
Three of the generation parameters forwarded to `inspect_ai.eval_set` do not
exist on `GenerateConfig`:
- `frequence_penalty` is a typo for `frequency_penalty`
- `log_probs` is spelled `logprobs`
- `response_format` is `response_schema`, and takes a `ResponseSchema`
rather than a string
None of these names have ever been correct — older inspect-ai releases
silently dropped unknown fields, so the three options were accepted on the
command line and then ignored. Current releases reject them, which turns a
silent no-op into a hard startup failure.
Rename all three (in the CLI and in `InspectAIModelConfig`) and parse
`--response-schema` into a `ResponseSchema`, accepting either a bare JSON
schema or a full `ResponseSchema` object.
The new test asserts every generation parameter is a real `GenerateConfig`
field and is exposed on the command line, so a name drifting out of sync
fails in CI rather than at a user's startup.
Fixes huggingface#1327
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.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.
Fixes #1327.
lighteval evalcrashes at startup on a fresh install, for every model and task:Three of the generation parameters
main_inspect.pyforwards toinspect_ai.eval_setare notGenerateConfigfields:frequence_penaltyfrequency_penaltylog_probslogprobsresponse_format(str)response_schema(ResponseSchema)Worth noting these names were never correct — they are wrong on
inspect-ai==0.3.140too, which is the declared minimum. Older releases just dropped unknown fields silently, so--frequence-penalty,--log-probsand--response-formatwere accepted on the command line and then had no effect. Current releases validate, which turns that silent no-op into a hard startup failure. So this is a rename rather than a compatibility shim, and it works across the whole supportedinspect-airange — no upper bound needed.Changes
evalcommand and inInspectAIModelConfig, which mirrors them.--response-schemanow parses its JSON string into aResponseSchema, accepting either a bare JSON schema (wrapped under the default nameresponse) or a fullResponseSchemaobject.tests/unit/test_main_inspect.py, which asserts every generation parameter is a realGenerateConfigfield and is exposed on the CLI. That's the regression guard — a name drifting out of sync now fails in CI instead of at a user's startup. Plus coverage for the schema parsing.Verification
The command from the issue now runs to completion on current
inspect-ai(0.3.258):tests/unit/test_main_inspect.pypasses (8 tests);ruff checkandruff format --checkare clean on the touched files.Note on the CLI rename
--frequence-penalty→--frequency-penaltyand--log-probs→--logprobsare user-visible flag renames. Since neither flag has ever had any effect (silently ignored before, crashing now), there is nothing depending on the old spellings. Happy to add hidden aliases for the old names if you'd rather not break them outright.