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

Method setup

espnet3/parallel/parallel.py:203–211  ·  view source on GitHub ↗

Set up the worker by calling the user-defined setup function.

(self, worker)

Source from the content-addressed store, hash-verified

201 self.setup_fn = setup_fn
202
203 def setup(self, worker):
204 """Set up the worker by calling the user-defined setup function."""
205 env = self.setup_fn()
206 if not isinstance(env, dict):
207 raise ValueError("setup_fn must return a dict")
208 worker.plugins["env"] = env
209
210 # Set worker id so that users can use it for identifing workers
211 os.environ["DASK_WORKER_ID"] = str(worker.id)
212
213
214def wrap_func_with_worker_env(func: Callable) -> Callable:

Callers 6

load_modelFunction · 0.45
finetune_segmentationFunction · 0.45
finetune_segmentationFunction · 0.45
app.pyFile · 0.45
app.pyFile · 0.45

Calls 1

setup_fnMethod · 0.80