espnet3.parallel.inference_provider.InferenceProvider
Less than 1 minute
espnet3.parallel.inference_provider.InferenceProvider
class espnet3.parallel.inference_provider.InferenceProvider(config: DictConfig, , params: Dict[str, Any] | None = None)
Bases: EnvironmentProvider, ABC
Provider base class tailored for inference-time datasets/models.
Subclasses implement dataset/model creation for local execution or per-worker setup. Instances cache a local environment for reuse.
Initialize the provider and prebuild the local environment.
- Parameters:
- config – Configuration for dataset/model construction.
- params – Optional extra entries merged into the environment.
abstractmethod static build_dataset(cfg: DictConfig)
Create a dataset object from config.
- Parameters:cfg – Configuration for dataset construction.
- Returns: Dataset-like object used for inference.
build_env_local() → Dict[str, Any]
Return the already constructed local environment.
- Returns: Mapping with dataset/model and any extra params.
abstractmethod static build_model(cfg: DictConfig)
Create a model object from config.
- Parameters:cfg – Configuration for model construction.
- Returns: Model-like object used for inference.
make_worker_setup_fn()
Return a setup function that rebuilds the env per worker.
- Returns: Callable that constructs a fresh environment when invoked.
