Skip to content

fix(inspect): align GenerateConfig field names with current inspect-ai (fixes #1327) - #1328

Open
sk8ordie84 wants to merge 2 commits into
huggingface:mainfrom
sk8ordie84:fix/inspect-ai-generateconfig-fields
Open

fix(inspect): align GenerateConfig field names with current inspect-ai (fixes #1327)#1328
sk8ordie84 wants to merge 2 commits into
huggingface:mainfrom
sk8ordie84:fix/inspect-ai-generateconfig-fields

Conversation

@sk8ordie84

Copy link
Copy Markdown

Fixes #1327.

A fresh pip install lighteval resolves inspect-ai to the latest release, and lighteval eval crashes at startup for any model/task with a pydantic ValidationError, because three GenerateConfig field names in main_inspect.py no longer exist upstream.

Changes:

  • frequence_penaltyfrequency_penalty (typo; matches the inspect-ai field name)
  • log_probslogprobs (matches the inspect-ai field name)
  • response_format is passed through only when the installed inspect-ai still accepts it (GenerateConfig.model_fields check); otherwise it is ignored with a warning. The field was removed upstream in inspect-ai ≥ 0.3.141, so unconditionally passing it can never work there.

Verified on inspect-ai 0.3.257 (Python 3.12):

  • the repro command from the issue (lighteval eval mockllm/model "lighteval|gsm8k|0" --max-samples 4 --log-dir out) now completes and writes results;
  • --frequency-penalty 0.5 --logprobs are accepted and forwarded;
  • --response-format '{"type":"object"}' no longer crashes (ignored with a warning on current inspect-ai).

Note: the two renamed CLI flags were unusable on current installs (startup crash), so the rename does not break any working invocation. Happy to add a deprecation alias if preferred.

- rename CLI/eval_set kwarg 'frequence_penalty' -> 'frequency_penalty' (typo; inspect-ai field name)
- rename 'log_probs' -> 'logprobs' (inspect-ai field name)
- pass 'response_format' only when the installed inspect-ai still accepts it, warn otherwise (removed in >= 0.3.141)

Fixes huggingface#1327: a fresh 'pip install lighteval' resolves inspect-ai to the latest release and 'lighteval eval' crashed at startup with a pydantic ValidationError. Verified on inspect-ai 0.3.257: the repro command from the issue now completes.
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

Successfully merging this pull request may close these issues.

lighteval eval crashes on fresh install: GenerateConfig rejects frequence_penalty / log_probs / response_format with current inspect-ai

1 participant