(
benchmark_file: str,
benchmark_name: str,
model_identifier: str | None,
ip_addr: str,
prompt_bundle_name: str = "default",
config_file: str | None = None,
output_file: str | None = None,
)
| 407 | |
| 408 | |
| 409 | def handle_run( |
| 410 | benchmark_file: str, |
| 411 | benchmark_name: str, |
| 412 | model_identifier: str | None, |
| 413 | ip_addr: str, |
| 414 | prompt_bundle_name: str = "default", |
| 415 | config_file: str | None = None, |
| 416 | output_file: str | None = None, |
| 417 | ) -> int: |
| 418 | config = _resolve_config(config_file) |
| 419 | benchmark = find_benchmark_by_name(Path(benchmark_file), benchmark_name) |
| 420 | model = _resolve_model_spec(model_identifier, config) |
| 421 | request = build_task_request( |
| 422 | benchmark=benchmark, |
| 423 | model=model, |
| 424 | ip_addr=ip_addr, |
| 425 | config=config, |
| 426 | prompt_bundle_name=prompt_bundle_name, |
| 427 | ) |
| 428 | result = TaskRunner().run(request) |
| 429 | payload = result.to_dict() |
| 430 | |
| 431 | if output_file: |
| 432 | write_jsonl_record(output_file, payload) |
| 433 | |
| 434 | print(json.dumps(payload, ensure_ascii=False, indent=2)) |
| 435 | return 0 if result.status != "error" else 1 |
| 436 | |
| 437 | |
| 438 | def handle_experiment( |
no test coverage detected