gt4sd.cli.upload module

Run model upload for the GT4SD. Two steps procedure: check if the folder/model name is already in the database. If not, upload it.

Summary

Classes:

SavingArgumentParser

Argument parser using a custom help logic.

SavingArguments

Algorithm saving arguments.

Functions:

main

Run an algorithm saving pipeline.

Reference

class SavingArguments(training_pipeline_name, target_version, algorithm_type=None, domain=None, algorithm_name=None, algorithm_application=None, source_version=None)[source]

Bases: object

Algorithm saving arguments.

__name__ = 'SavingArguments'
training_pipeline_name: str
target_version: str
algorithm_type: Optional[str] = None
domain: Optional[str] = None
algorithm_name: Optional[str] = None
algorithm_application: Optional[str] = None
source_version: Optional[str] = None
__annotations__ = {'algorithm_application': typing.Optional[str], 'algorithm_name': typing.Optional[str], 'algorithm_type': typing.Optional[str], 'domain': typing.Optional[str], 'source_version': typing.Optional[str], 'target_version': <class 'str'>, 'training_pipeline_name': <class 'str'>}
__dataclass_fields__ = {'algorithm_application': Field(name='algorithm_application',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Inference algorithm application.'}),kw_only=False,_field_type=_FIELD), 'algorithm_name': Field(name='algorithm_name',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Inference algorithm name.'}),kw_only=False,_field_type=_FIELD), 'algorithm_type': Field(name='algorithm_type',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Inference algorithm type, supported types: conditional_generation, controlled_sampling, generation, prediction.'}),kw_only=False,_field_type=_FIELD), 'domain': Field(name='domain',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Domain of the inference algorithm, supported types: materials, nlp, vision.'}),kw_only=False,_field_type=_FIELD), 'source_version': Field(name='source_version',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Source algorithm version to use for missing artifacts.'}),kw_only=False,_field_type=_FIELD), 'target_version': Field(name='target_version',type=<class 'str'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Target algorithm version to save.'}),kw_only=False,_field_type=_FIELD), 'training_pipeline_name': Field(name='training_pipeline_name',type=<class 'str'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Training pipeline name, supported pipelines: cgcnn, crystals-rfc, diffusion-trainer, gflownet-trainer, granular-trainer, guacamol-lstm-trainer, language-modeling-trainer, molformer, moses-organ-trainer, moses-vae-trainer, paccmann-vae-trainer, regression-transformer-trainer, torchdrug-gcpn-trainer, torchdrug-graphaf-trainer.'}),kw_only=False,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False)
__dict__ = mappingproxy({'__module__': 'gt4sd.cli.upload', '__annotations__': {'training_pipeline_name': <class 'str'>, 'target_version': <class 'str'>, 'algorithm_type': typing.Optional[str], 'domain': typing.Optional[str], 'algorithm_name': typing.Optional[str], 'algorithm_application': typing.Optional[str], 'source_version': typing.Optional[str]}, '__doc__': 'Algorithm saving arguments.', '__name__': 'saving_base_args', 'algorithm_type': None, 'domain': None, 'algorithm_name': None, 'algorithm_application': None, 'source_version': None, '__dict__': <attribute '__dict__' of 'SavingArguments' objects>, '__weakref__': <attribute '__weakref__' of 'SavingArguments' objects>, '__dataclass_params__': _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False), '__dataclass_fields__': {'training_pipeline_name': Field(name='training_pipeline_name',type=<class 'str'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Training pipeline name, supported pipelines: cgcnn, crystals-rfc, diffusion-trainer, gflownet-trainer, granular-trainer, guacamol-lstm-trainer, language-modeling-trainer, molformer, moses-organ-trainer, moses-vae-trainer, paccmann-vae-trainer, regression-transformer-trainer, torchdrug-gcpn-trainer, torchdrug-graphaf-trainer.'}),kw_only=False,_field_type=_FIELD), 'target_version': Field(name='target_version',type=<class 'str'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Target algorithm version to save.'}),kw_only=False,_field_type=_FIELD), 'algorithm_type': Field(name='algorithm_type',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Inference algorithm type, supported types: conditional_generation, controlled_sampling, generation, prediction.'}),kw_only=False,_field_type=_FIELD), 'domain': Field(name='domain',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Domain of the inference algorithm, supported types: materials, nlp, vision.'}),kw_only=False,_field_type=_FIELD), 'algorithm_name': Field(name='algorithm_name',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Inference algorithm name.'}),kw_only=False,_field_type=_FIELD), 'algorithm_application': Field(name='algorithm_application',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Inference algorithm application.'}),kw_only=False,_field_type=_FIELD), 'source_version': Field(name='source_version',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'help': 'Source algorithm version to use for missing artifacts.'}),kw_only=False,_field_type=_FIELD)}, '__init__': <function SavingArguments.__init__>, '__repr__': <function SavingArguments.__repr__>, '__eq__': <function SavingArguments.__eq__>, '__hash__': None, '__match_args__': ('training_pipeline_name', 'target_version', 'algorithm_type', 'domain', 'algorithm_name', 'algorithm_application', 'source_version')})
__doc__ = 'Algorithm saving arguments.'
__eq__(other)

Return self==value.

__hash__ = None
__init__(training_pipeline_name, target_version, algorithm_type=None, domain=None, algorithm_name=None, algorithm_application=None, source_version=None)
__match_args__ = ('training_pipeline_name', 'target_version', 'algorithm_type', 'domain', 'algorithm_name', 'algorithm_application', 'source_version')
__module__ = 'gt4sd.cli.upload'
__repr__()

Return repr(self).

__weakref__

list of weak references to the object (if defined)

class SavingArgumentParser(dataclass_types, **kwargs)[source]

Bases: ArgumentParser

Argument parser using a custom help logic.

print_help(file=None)[source]

Print help checking dynamically whether a specific pipeline is passed.

Parameters

file (Optional[IO[str], None]) – an optional I/O stream. Defaults to None, a.k.a., stdout and stderr.

Return type

None

__annotations__ = {}
__doc__ = 'Argument parser using a custom help logic.'
__module__ = 'gt4sd.cli.upload'
main()[source]

Run an algorithm saving pipeline.

Raises

ValueError – in case the provided training pipeline provided is not supported.

Return type

None