espnet3.parallel.parallel.build_client
Less than 1 minute
espnet3.parallel.parallel.build_client
espnet3.parallel.parallel.build_client(config: DictConfig = None) → Client
Create or retrieve a Dask client using the provided or global configuration.
- Parameters:config (DictConfig , optional) – Cluster config. If None, uses global one.
- Returns: Dask client instance.
- Return type: Client
- Raises:ValueError – If
configis None and no global config has been set viaset_parallel().
Example
>>> from omegaconf import OmegaConf
>>> cfg = OmegaConf.create({"env": "local", "n_workers": 2, "options": {}})
>>> client = build_client(cfg)
>>> client.close()