Skip to content

Commit

Permalink
Support INSPECT_EVAL_MODEL_ARGS environment variable for calls to `ev…
Browse files Browse the repository at this point in the history
…al()` (#733)
  • Loading branch information
jjallaire authored Oct 20, 2024
1 parent 3e913aa commit 182fbe0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Llama: remove extraneous <|start_header_id|>assistant<|end_header_id|> if it appears in an assistant message.
- Use Dockerhub aisiuk/inspect-web-browser-tool image for web browser tool.
- Use ParamSpec to capture types of decorated solvers, tools, scorers, and metrics.
- Support INSPECT_EVAL_MODEL_ARGS environment variable for calls to `eval()`.
- Requirements: require semver>=3.0.0
- Added `delimiter` option to `csv_dataset()` (defaults to ",")
- Improve answer detection in multiple choice scorer.
Expand Down
8 changes: 8 additions & 0 deletions src/inspect_ai/_eval/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from shortuuid import uuid
from typing_extensions import Unpack

from inspect_ai._cli.util import parse_cli_args
from inspect_ai._util.error import PrerequisiteError
from inspect_ai._util.file import absolute_file_path
from inspect_ai._util.platform import platform_init
Expand Down Expand Up @@ -687,6 +688,13 @@ def eval_init(
# init eval context
init_eval_context(trace, log_level, log_level_transcript, max_subprocesses)

# resolve model args from environment if not specified
if len(model_args) == 0:
env_model_args = os.environ.get("INSPECT_EVAL_MODEL_ARGS", None)
if env_model_args:
args = [arg.strip() for arg in env_model_args.split(" ")]
model_args = parse_cli_args(args)

# resolve models
generate_config = GenerateConfig(**kwargs)
models = resolve_models(model, model_base_url, model_args, generate_config)
Expand Down

0 comments on commit 182fbe0

Please sign in to comment.