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 thescvi.model
module, for example, if you are using a model class from a custom module.
Attributes table#
Methods table#
|
Create a |
Attributes#
model_parent_module
training_data_url
scvi_version
anndata_version
model_cls_name
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.