(config: dict[str, Any], args: argparse.Namespace)
| 748 | for family in selected_families(args) |
| 749 | } |
| 750 | if len(values) == 1: |
| 751 | return next(iter(values)) |
| 752 | return args.requests_per_session |
| 753 | |
| 754 | |
| 755 | def load_omnivoice_case_catalog(path: Path) -> dict[str, dict[str, dict[str, Any]]]: |
| 756 | payload = json.loads(path.read_text(encoding="utf-8")) |
| 757 | if not isinstance(payload, dict): |
| 758 | raise RuntimeError(f"invalid OmniVoice case catalog: {path}") |
| 759 | return payload |
| 760 | |
| 761 | |
| 762 | def resolve_omnivoice_case( |
| 763 | config: dict[str, Any], |
| 764 | args: argparse.Namespace, |
| 765 | ) -> tuple[list[str], dict[str, Any], dict[str, Any]]: |
| 766 | if args.case_names and args.texts: |
| 767 | raise RuntimeError("--case-name and --text are mutually exclusive for OmniVoice warmbench") |
| 768 | |
| 769 | scenario_config = dict(config) |
| 770 | warmup_text = args.warmup_text or OMNIVOICE_DEFAULT_WARMUP_TEXT |
| 771 | request_manifest: dict[str, Any] = {"warmup_text": warmup_text} |
| 772 | if args.texts: |
| 773 | if len(args.texts) < args.requests_per_session: |
| 774 | raise RuntimeError( |
| 775 | f"need {args.requests_per_session} --text values, only received {len(args.texts)}" |
| 776 | ) |
no test coverage detected