Module: ml_model_id
MlModelId
Bases: BaseModel
Attributes:
Name | Type | Description |
---|---|---|
ml_type |
Optional[MLType]
|
MLType - The type of machine learning model |
repo_id |
RitualRepoId
|
RitualRepoId - The repository id of the model |
files |
List[str]
|
List[str] - The list of files that make up the model |
Properties
Source code in src/infernet_ml/utils/specs/ml_model_id.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
arweave_repo_id: str
property
Get the arweave repository id of the model, as implemented in the RitualRepoId class.
Returns:
Type | Description |
---|---|
str
|
str - The arweave repository id of the model |
hf_repo_id: str
property
Get the huggingface repository id of the model, if it is a huggingface model.
Returns:
Type | Description |
---|---|
str
|
str - The huggingface repository id of the model |
to_web3: bytes
property
Get the web3 encoding of the model id.
Returns:
Type | Description |
---|---|
bytes
|
bytes - The web3 encoding of the model id |
unique_id: str
property
Get the unique identifier of the model. This has the format:
Returns:
Type | Description |
---|---|
str
|
str - The unique identifier of the model |
version: str | None
property
Get the version of the model, as denoted by the version of the model's repository.
Returns:
Type | Description |
---|---|
str | None
|
str - The version of the model |
from_any(model, ml_type=None)
classmethod
Utility function to convert a string or MlModelId to an MlModelId.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model |
MlModelId | str
|
MlModelId | str - The model id or unique identifier |
required |
ml_type |
Optional[MLType]
|
MLType - The type of machine learning model |
None
|
Source code in src/infernet_ml/utils/specs/ml_model_id.py
from_unique_id(unique_id, ml_type=None)
classmethod
Create a ModelId from a unique identifier.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
unique_id |
str
|
str - The unique identifier of the model |
required |
ml_type |
Optional[MLType]
|
MLType - The type of machine learning model |
None
|
Returns:
Type | Description |
---|---|
MlModelId
|
MlModelId - The model id |
Source code in src/infernet_ml/utils/specs/ml_model_id.py
from_web3(encoding)
classmethod
Create a ModelId from a web3 encoding.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
encoding |
bytes
|
bytes - The web3 encoding of the model id |
required |
Returns:
Type | Description |
---|---|
MlModelId
|
MlModelId - The model id |