| 74 | |
| 75 | |
| 76 | def load_requests(args: argparse.Namespace) -> list[dict[str, Any]]: |
| 77 | if args.request_sequence_json: |
| 78 | payload = json.loads(args.request_sequence_json) |
| 79 | if not isinstance(payload, list): |
| 80 | raise RuntimeError("--request-sequence-json must decode to a list") |
| 81 | return payload |
| 82 | if args.request_json: |
| 83 | payload = json.loads(args.request_json) |
| 84 | if not isinstance(payload, dict): |
| 85 | raise RuntimeError("--request-json must decode to an object") |
| 86 | return [payload] |
| 87 | raise RuntimeError("ACE-Step warmbench requires --request-json or --request-sequence-json") |
| 88 | |
| 89 | |
| 90 | def normalize_device(backend: str, device_index: int) -> str: |