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 aPretrainedModelso callers that need the config, card or cutoff (an ASE calculator, the MDI engine,xnn export) get them without reloading. Seefetch_model()for the source and cache options andbuild_potential()fordtype,dispersion,eeq_reuseandmodel_options.use_fast("auto",TrueorFalse) chooses between the fused GPU kernels and the reference implementation of the blocks that have both (seexnn.common.models.fast).- Returns:
The model and its metadata.
- Return type:
- Raises:
ValueError – If the checkpoint embeds no config.
- Parameters: