Skip to content

loadable

loadable

Loadable

Loadable(*args: Any, **kwargs: Any)

Bases: Envoy

An Envoy that loads its own module.

The constructor accepts either a ready torch.nn.Module or load arguments (e.g. a repo id) and dispatches accordingly: a ready module goes to _wrap (base: build the tree over it as-is), anything else to _load (build the module from the arguments). Subclasses override whichever paths they support; an override never receives the other path's argument kind.

Keyword arguments split by split_envoy_kwargs: Envoy's parameters go to Envoy.__init__, the rest to the load path.

split_envoy_kwargs

split_envoy_kwargs(kwargs: dict) -> tuple[dict, dict]

Split kwargs into (envoy_kwargs, load_kwargs).

Envoy's own parameters (interleaver, rename, ...) route to Envoy.__init__; everything else is a load argument for Loadable._load.