physioex.models.load_from_pretrained#
- physioex.models.load_from_pretrained(name, device='cpu', verbose=False, repo_id=None)[source]#
Load a pretrained model from HuggingFace Hub.
The model class and constructor kwargs are read from
config.jsonstored alongside the weights on HuggingFace. The caller only needs to know the model identifier (e.g."seqsleepnet-huy").- Parameters:
- Returns:
The pretrained
nn.Modulein eval mode on device.- Return type:
Example:
from physioex.models import load_from_pretrained model = load_from_pretrained("seqsleepnet-huy", verbose=True)