xnn.common.models.hub.loader.load_pretrained#

xnn.common.models.hub.loader.load_pretrained(source, *, cache_dir=None, filename=None, head=None, format=None, force_download=False, local_files_only=False, quiet=False, device='cpu', dtype=None, dispersion=None, compute_forces=True, compute_stress=False, eeq_reuse=False, use_fast='auto', model_options=None)[source]#

Load a pre-trained model together with its config and card.

The same as from_pretrained(), returning a PretrainedModel so callers that need the config, card or cutoff (an ASE calculator, the MDI engine, xnn export) get them without reloading. See fetch_model() for the source and cache options and build_potential() for dtype, dispersion, eeq_reuse and model_options. use_fast ("auto", True or False) chooses between the fused GPU kernels and the reference implementation of the blocks that have both (see xnn.common.models.fast).

Returns:

The model and its metadata.

Return type:

PretrainedModel

Raises:

ValueError – If the checkpoint embeds no config.

Parameters: