wsinfer.modellib.models#

Classes#

Functions#

get_registered_model(...)

get_pretrained_torch_module(→ torch.nn.Module)

Get a PyTorch Module with weights loaded.

jit_compile(...)

JIT-compile a model for inference.

Module Contents#

class wsinfer.modellib.models.LocalModelTorchScript[source]#

Bases: wsinfer_zoo.client.Model

wsinfer.modellib.models.get_registered_model(name: str) wsinfer_zoo.client.HFModelTorchScript[source]#
wsinfer.modellib.models.get_pretrained_torch_module(model: wsinfer_zoo.client.HFModelTorchScript | LocalModelTorchScript) torch.nn.Module[source]#

Get a PyTorch Module with weights loaded.

wsinfer.modellib.models.jit_compile(model: torch.nn.Module) torch.jit.ScriptModule | torch.nn.Module | Callable[source]#

JIT-compile a model for inference.

A torchscript model may be JIT compiled here as well.