(num_prompts: int, dataset_name: str, dataset_path: str)
| 25 | |
| 26 | |
| 27 | def prepare_input_requests(num_prompts: int, dataset_name: str, dataset_path: str) -> Union[EBDataset, EBChatDataset]: |
| 28 | dataset_mapping = { |
| 29 | "EB": lambda: EBDataset(dataset_path=dataset_path).sample(num_requests=num_prompts), |
| 30 | "EBChat": lambda: EBChatDataset(dataset_path=dataset_path).sample(num_requests=num_prompts), |
| 31 | } |
| 32 | |
| 33 | try: |
| 34 | input_requests = dataset_mapping[dataset_name]() |
| 35 | except KeyError as err: |
| 36 | raise ValueError(f"Unknown dataset: {dataset_name}") from err |
| 37 | |
| 38 | return input_requests |
| 39 | |
| 40 | |
| 41 | class FakeTokenizer: |
no test coverage detected