|
33 | 33 | from ._utils.cli import str2bool |
34 | 34 |
|
35 | 35 |
|
36 | | -def parse_common_args(kwargs: dict[str, Any], *, default_enable_hpi: bool | None) -> dict[str, Any]: |
| 36 | +def parse_common_args( |
| 37 | + kwargs: dict[str, Any], *, default_enable_hpi: bool | None |
| 38 | +) -> dict[str, Any]: |
37 | 39 | default_vals = { |
38 | 40 | "device": DEFAULT_DEVICE, |
39 | 41 | "enable_hpi": default_enable_hpi, |
@@ -62,7 +64,9 @@ def parse_common_args(kwargs: dict[str, Any], *, default_enable_hpi: bool | None |
62 | 64 | return kwargs |
63 | 65 |
|
64 | 66 |
|
65 | | -def prepare_common_init_args(model_name: str | None, common_args: dict[str, Any]) -> dict[str, Any]: |
| 67 | +def prepare_common_init_args( |
| 68 | + model_name: str | None, common_args: dict[str, Any] |
| 69 | +) -> dict[str, Any]: |
66 | 70 | device = common_args["device"] |
67 | 71 | if device is None: |
68 | 72 | device = get_default_device() |
@@ -99,7 +103,12 @@ def prepare_common_init_args(model_name: str | None, common_args: dict[str, Any] |
99 | 103 | return init_kwargs |
100 | 104 |
|
101 | 105 |
|
102 | | -def add_common_cli_opts(parser: argparse.ArgumentParser, *, default_enable_hpi: bool | None, allow_multiple_devices: bool) -> None: |
| 106 | +def add_common_cli_opts( |
| 107 | + parser: argparse.ArgumentParser, |
| 108 | + *, |
| 109 | + default_enable_hpi: bool | None, |
| 110 | + allow_multiple_devices: bool, |
| 111 | +) -> None: |
103 | 112 | if allow_multiple_devices: |
104 | 113 | help_ = "Device(s) to use for inference, e.g., `cpu`, `gpu`, `npu`, `gpu:0`, `gpu:0,1`. If multiple devices are specified, inference will be performed in parallel. Note that parallel inference is not always supported. By default, GPU 0 will be used if available; otherwise, the CPU will be used." |
105 | 114 | else: |
|
0 commit comments