MCPcopy Create free account
hub / github.com/espnet/espnet / build_client

Function build_client

espnet3/parallel/parallel.py:171–189  ·  view source on GitHub ↗

Create or retrieve a Dask client using the provided or global configuration. Args: config (DictConfig, optional): Cluster config. If None, uses global one. Returns: Client: Dask client instance.

(config: DictConfig = None)

Source from the content-addressed store, hash-verified

169
170
171def build_client(config: DictConfig = None) -> Client:
172 """Create or retrieve a Dask client using the provided or global configuration.
173
174 Args:
175 config (DictConfig, optional): Cluster config. If None, uses global one.
176
177 Returns:
178 Client: Dask client instance.
179 """
180 if config is not None:
181 set_parallel(config)
182 return _build_client(config)
183
184 if parallel_config is None:
185 raise ValueError(
186 "Parallel configuration not set. Use `set_parallel` to set it."
187 )
188
189 return _build_client(parallel_config)
190
191
192class DictReturnWorkerPlugin(WorkerPlugin):

Calls 2

set_parallelFunction · 0.85
_build_clientFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…