Skip to content

Spec

ModelParams

Bases: SpecParams

Model parameters.

Source code in digitalhub_ml/entities/models/spec.py
22
23
24
25
26
27
28
29
30
31
32
33
34
class ModelParams(SpecParams):
    """
    Model parameters.
    """

    path: str
    """Path to the model."""

    framework: str = None
    """Model framework (e.g. 'pytorch')."""

    algorithm: str = None
    """Model algorithm (e.g. 'resnet')."""

algorithm: str = None class-attribute instance-attribute

Model algorithm (e.g. 'resnet').

framework: str = None class-attribute instance-attribute

Model framework (e.g. 'pytorch').

path: str instance-attribute

Path to the model.

ModelParamsModel

Bases: ModelParams

Model parameters.

Source code in digitalhub_ml/entities/models/spec.py
58
59
60
61
62
63
64
65
66
67
68
69
70
class ModelParamsModel(ModelParams):
    """
    Model parameters.
    """

    base_model: str = None
    """Base model."""

    parameters: dict = None
    """Model parameters."""

    metrics: dict = None
    """Model metrics."""

base_model: str = None class-attribute instance-attribute

Base model.

metrics: dict = None class-attribute instance-attribute

Model metrics.

parameters: dict = None class-attribute instance-attribute

Model parameters.

ModelSpec

Bases: Spec

Model specifications.

Source code in digitalhub_ml/entities/models/spec.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
class ModelSpec(Spec):
    """
    Model specifications.
    """

    def __init__(
        self,
        path: str,
        framework: str | None = None,
        algorithm: str | None = None,
    ) -> None:
        self.path = path
        self.framework = framework
        self.algorithm = algorithm

ModelSpecModel

Bases: ModelSpec

Model specifications.

Source code in digitalhub_ml/entities/models/spec.py
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
class ModelSpecModel(ModelSpec):
    """
    Model specifications.
    """

    def __init__(
        self,
        path: str,
        framework: str | None = None,
        algorithm: str | None = None,
        base_model: str | None = None,
        parameters: dict | None = None,
        metrics: dict | None = None,
        **kwargs,
    ) -> None:
        super().__init__(path, framework, algorithm)
        self.base_model = base_model
        self.parameters = parameters
        self.metrics = metrics