class_docstr: Loads models of type ``ModelT``.
docstr: :param asset_store:
      The asset store where to check for available models.
  :param download_manager:
      The download manager to download model checkpoints.
  :param config_loader:
      The configuration loader.
  :param model_factory:
      The factory to construct models.
  :param checkpoint_converter:
      The converter to which loaded checkpoints will be passed for further
      processing.
  :param restrict_checkpoints:
      If ``True``, restricts the Python unpickler to load only tensors,
      primitive types, and dictionaries.
docstr_tok: [":","param","asset_store",":","The","asset","store","where","to","check","for","available","models",".",":","param","download_manager",":","The","download","manager","to","download","model","checkpoints",".",":","param","config_loader",":","The","configuration","loader",".",":","param","model_factory",":","The","factory","to","construct","models",".",":","param","checkpoint_converter",":","The","converter","to","which","loaded","checkpoints","will","be","passed","for","further","processing",".",":","param","restrict_checkpoints",":","If","``","True","``",",","restricts","the","Python","unpickler","to","load","only","tensors",",","primitive","types",",","and","dictionaries","."]
code: def __init__(
      self,
      asset_store: AssetStore,
      download_manager: AssetDownloadManager,
      config_loader: ConfigLoader[ConfigT],
      model_factory: ModelFactory[ConfigT, ModelT],
      checkpoint_converter: Optional[
          CheckpointConverter[ConfigT]
      ] = None,
      restrict_checkpoints: bool = True,
  ) -> None:
      """
      :param asset_store:
          The asset store where to check for available models.
      :param download_manager:
          The download manager to download model checkpoints.
      :param config_loader:
          The configuration loader.
      :param model_factory:
          The factory to construct models.
      :param checkpoint_converter:
          The converter to which loaded checkpoints will be passed for further
          processing.
      :param restrict_checkpoints:
          If ``True``, restricts the Python unpickler to load only tensors,
          primitive types, and dictionaries.
      """
      self.asset_store = asset_store
      self.download_manager = download_manager
      self.config_loader = config_loader
      self.model_factory = model_factory
      self.checkpoint_converter = checkpoint_converter
      self.restrict_checkpoints = restrict_checkpoints
  
imports: import logging
  from abc import ABC, abstractmethod
  from copy import deepcopy
  from functools import partial
  from pathlib import Path
  from pickle import PickleError
  from typing import Any, Dict, Generic, Optional, Protocol, TypeVar, Union, final
  from torch.nn import Module
  from fairseq2.assets import AssetCard, AssetCardError, AssetCardFieldNotFoundError, AssetDownloadManager, AssetError, AssetStore
  from fairseq2.data import PathLike
  from fairseq2.data.text import TextTokenizer
  from fairseq2.models.utils.arch_registry import ArchitectureRegistry
  from fairseq2.models.utils.checkpoint import load_checkpoint
  from fairseq2.nn.utils.module import infer_device, reset_non_persistent_buffers, to_empty
  from fairseq2.typing import CPU, META, DataType, Device, finaloverride
  from fairseq2.utils.dataclass import update_dataclass
label_desc: Use image node_id 1 to create a new ModelLoader object from inherited base classes: Generic with example: obj = ModelLoader(asset_store, download_manager, config_loader, model_factory, checkpoint_converter, restrict_checkpoints)