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 (
str
|None
(default:None
)) – 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
(default:'scvi.model'
)) – 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#
Attributes#
Methods#
- 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 (
device
|str
|dict
|None
(default:'cpu'
)) – The device to map model tensors to, passed intoload()
.kwargs – Additional keyword arguments to pass to the HubMetadata initializer.