scvi.hub.HubModelCardHelper#
- class scvi.hub.HubModelCardHelper(license_info, model_cls_name, model_init_params, model_setup_anndata_args, model_summary_stats, model_data_registry, scvi_version, anndata_version, data_modalities=list(), tissues=list(), data_is_annotated=None, data_is_minified=None, training_data_url=None, training_code_url=None, model_parent_module='scvi.model', description='To be added...', references='To be added...', metrics_report=None)[source]#
A helper for creating a
ModelCardforscvi-toolshub models.- Parameters:
- license_info
str The license information for the model.
- model_cls_name
str The name of the model class.
- model_init_params
dict The model initialization parameters.
- model_setup_anndata_args
dict The arguments used to call
setup_anndataduring model training.- model_summary_stats
dict The model summary statistics.
- model_data_registry
dict The model data registry.
- scvi_version
str The version of
scvi-toolsthat the model was trained with.- anndata_version
str The version of anndata used during model training.
- data_modalities
list[str] (default:list()) The modalities of the training data.
- tissues
list[str] (default:list()) The tissues of the training data.
- data_is_annotated
bool|None(default:None) Whether the training data is annotated.
- data_is_minified
bool|None(default:None) Whether the training data uploaded with the model has been minified.
- 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/).
- training_code_url
str|None(default:None) Link to the code used to train the model.
- 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 thescvi.modelmodule, for example, if you are using a model class from a custom module.- description
str(default:'To be added...') A description of the model.
- references
A list of references for the model.
- metrics_report
str|None(default:None) A dictionary containing the metrics report for the model.
- license_info
Notes
It is not required to use this class to create a
ModelCard. But this helps you do so in a way that is consistent with most otherscvi-toolshub models. You can think of this as a template. The actual template string used can be found inscvi.template. The resulting huggingfaceModelCardcan be accessed via themodel_card()property.
Attributes table#
Methods table#
|
Create a |
Attributes#
Methods#
- classmethod HubModelCardHelper.from_dir(local_dir, license_info, anndata_version, metrics_report=None, data_is_minified=None, map_location='cpu', **kwargs)[source]#
Create a
HubModelCardHelperobject from a local directory.- Parameters:
- local_dir
str The local directory containing the model files.
- license_info
str The license information for the model.
- anndata_version
str The version of anndata used during model training.
- metrics_report
str|None(default:None) Path to the json with stored metrics report.
- data_is_minified
bool|None(default:None) Whether the training data uploaded with the model has been minified.
- map_location
device|str|dict|None(default:'cpu') The device to map model tensors to, passed into
load().- kwargs
Additional keyword arguments to pass to the HubModelCardHelper initializer.
- local_dir