scvi.hub.HubMetadata#

class scvi.hub.HubMetadata(scvi_version, anndata_version, model_cls_name, training_data_url=None, model_parent_module='scvi.model')[source]#

Encapsulates the required metadata for scvi-tools hub models.

Parameters:
  • scvi_version (str) – The version of scvi-tools that the model was trained with.

  • anndata_version (str) – The version of anndata used during model training.

  • model_cls_name (str) – The name of the model class.

  • training_data_url (Optional[str]) – Link to the training data used to train the model, if it is too large to be uploaded to the hub. This can be a cellxgene explorer session url. However it cannot be a self-hosted session – it must be from the cellxgene portal (https://cellxgene.cziscience.com/).

  • model_parent_module (str) – The parent module of the model class. Defaults to scvi.model. Change this if you are using a model class that is not in the scvi.model module, for example, if you are using a model class from a custom module.

Attributes table#

Methods table#

from_dir(local_dir, anndata_version[, ...])

Create a HubMetadata object from a local directory.

Attributes#

model_parent_module

HubMetadata.model_parent_module: str = 'scvi.model'#

training_data_url

HubMetadata.training_data_url: Optional[str] = None#

scvi_version

HubMetadata.scvi_version: str#

anndata_version

HubMetadata.anndata_version: str#

model_cls_name

HubMetadata.model_cls_name: str#

Methods#

from_dir

classmethod HubMetadata.from_dir(local_dir, anndata_version, map_location='cpu', **kwargs)[source]#

Create a HubMetadata object from a local directory.

Parameters:
  • local_dir (str) – The local directory containing the model files.

  • anndata_version (str) – The version of anndata used during model training.

  • map_location (Optional[Union[device, str, dict]]) – The device to map model tensors to, passed into load().

  • kwargs – Additional keyword arguments to pass to the HubMetadata initializer.