/
azure.ai.ml.entities.ModelPackage.yml
225 lines (211 loc) · 8.62 KB
/
azure.ai.ml.entities.ModelPackage.yml
1
2
3
4
5
6
7
8
9
10
11
12
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
### YamlMime:PythonClass
uid: azure.ai.ml.entities.ModelPackage
name: ModelPackage
fullName: azure.ai.ml.entities.ModelPackage
module: azure.ai.ml.entities
inheritances:
- azure.ai.ml.entities._resource.Resource
- azure.ai.ml._restclient.v2023_08_01_preview.models._models_py3.PackageRequest
summary: '> [!NOTE]
> This is an experimental class, and may change at any time. Please see [https://aka.ms/azuremlexperimental](https://aka.ms/azuremlexperimental)
for more information.
>
Model package.'
constructor:
syntax: 'ModelPackage(*, target_environment: str | Dict[str, str], inferencing_server:
AzureMLOnlineInferencingServer | AzureMLBatchInferencingServer, base_environment_source:
BaseEnvironment | None = None, environment_variables: Dict[str, str] | None =
None, inputs: List[ModelPackageInput] | None = None, model_configuration: ModelConfiguration
| None = None, tags: Dict[str, str] | None = None, **kwargs: Any)'
parameters:
- name: target_environment_name
description: The target environment name for the model package.
isRequired: true
types:
- <xref:str>
- name: inferencing_server
description: The inferencing server of the model package.
isRequired: true
types:
- <xref:typing.Union>[<xref:azure.ai.ml.entities.AzureMLOnlineInferencingServer>,
<xref:azure.ai.ml.entities.AzureMLBatchInferencingServer>]
- name: base_environment_source
description: The base environment source of the model package.
isRequired: true
types:
- <xref:typing.Optional>[<xref:azure.ai.ml.entities.BaseEnvironment>]
- name: target_environment_version
description: The version of the model package.
isRequired: true
types:
- <xref:typing.Optional>[<xref:str>]
- name: environment_variables
description: The environment variables of the model package.
isRequired: true
types:
- <xref:typing.Optional>[<xref:dict>[<xref:str>, <xref:str>]]
- name: inputs
description: The inputs of the model package.
isRequired: true
types:
- <xref:typing.Optional>[<xref:list>[<xref:azure.ai.ml.entities.ModelPackageInput>]]
- name: model_configuration
description: The model configuration.
isRequired: true
types:
- <xref:typing.Optional>[<xref:azure.ai.ml.entities.ModelConfiguration>]
- name: tags
description: The tags of the model package.
isRequired: true
types:
- <xref:typing.Optional>[<xref:dict>[<xref:str>, <xref:str>]]
examples:
- "Create a Model Package object.<!--[!code-python[Main](les\\ml_samples_misc.py )]-->\n\
\n<!-- literal_block {\"ids\": [], \"classes\": [], \"names\": [], \"dupnames\"\
: [], \"backrefs\": [], \"source\": \"C:\\\\hostedtoolcache\\\\windows\\\\Python\\\
\\3.11.9\\\\x64\\\\Lib\\\\site-packages\\\\py2docfx\\\\dist_temp\\\\10\\\\azure-ai-ml-1.16.0\\\
\\samples\\\\ml_samples_misc.py\", \"xml:space\": \"preserve\", \"force\": false,\
\ \"language\": \"python\", \"highlight_args\": {\"linenostart\": 1}, \"linenos\"\
: false} -->\n\n````python\n\n from azure.ai.ml.entities import AzureMLOnlineInferencingServer,\
\ CodeConfiguration, ModelPackage\n\n modelPackage = ModelPackage(\n inferencing_server=AzureMLOnlineInferencingServer(\n\
\ code_configuration=CodeConfiguration(code=\"../model-1/foo/\", scoring_script=\"\
score.py\")\n ),\n target_environment_name=\"env-name\",\n target_environment_version=\"\
1.0\",\n environment_variables={\"env1\": \"value1\", \"env2\": \"value2\"\
},\n tags={\"tag1\": \"value1\", \"tag2\": \"value2\"},\n )\n\n ````\n"
methods:
- uid: azure.ai.ml.entities.ModelPackage.as_dict
name: as_dict
summary: "Return a dict that can be JSONify using json.dump.\n\nAdvanced usage might\
\ optionally use a callback as parameter:\n\nKey is the attribute name used in\
\ Python. Attr_desc\nis a dict of metadata. Currently contains 'type' with the\n\
msrest type and 'key' with the RestAPI encoded key.\nValue is the current value\
\ in this object.\n\nThe string returned will be used to serialize the key.\n\
If the return type is a list, this is considered hierarchical\nresult dict.\n\n\
See the three examples in this file:\n\n* attribute_transformer \n\n* full_restapi_key_transformer\
\ \n\n* last_restapi_key_transformer \n\nIf you want XML serialization, you can\
\ pass the kwargs is_xml=True."
signature: as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>,
**kwargs)
parameters:
- name: key_transformer
description: A key transformer function.
types:
- <xref:function>
- name: keep_readonly
defaultValue: 'True'
return:
description: A dict JSON compatible object
types:
- <xref:dict>
- uid: azure.ai.ml.entities.ModelPackage.deserialize
name: deserialize
summary: Parse a str using the RestAPI syntax and return a model.
signature: deserialize(data, content_type=None)
parameters:
- name: data
description: A str using RestAPI structure. JSON by default.
isRequired: true
types:
- <xref:str>
- name: content_type
description: JSON by default, set application/xml if XML.
defaultValue: None
types:
- <xref:str>
return:
description: An instance of this model
exceptions:
- type: DeserializationError if something went wrong
- uid: azure.ai.ml.entities.ModelPackage.dump
name: dump
summary: Dumps the job content into a file in YAML format.
signature: 'dump(dest: str | PathLike | IO, **kwargs: Any) -> None'
parameters:
- name: dest
description: 'The local path or file stream to write the YAML content to.
If dest is a file path, a new file will be created.
If dest is an open file, the file will be written to directly.'
isRequired: true
types:
- <xref:typing.Union>[<xref:PathLike>, <xref:str>, <xref:typing.IO>[<xref:typing.AnyStr>]]
exceptions:
- type: FileExistsError
description: Raised if dest is a file path and the file already exists.
- type: IOError
description: Raised if dest is an open file and the file is not writable.
- uid: azure.ai.ml.entities.ModelPackage.enable_additional_properties_sending
name: enable_additional_properties_sending
signature: enable_additional_properties_sending()
- uid: azure.ai.ml.entities.ModelPackage.from_dict
name: from_dict
summary: 'Parse a dict using given key extractor return a model.
By default consider key
extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor
and last_rest_key_case_insensitive_extractor)'
signature: from_dict(data, key_extractors=None, content_type=None)
parameters:
- name: data
description: A dict using RestAPI structure
isRequired: true
types:
- <xref:dict>
- name: content_type
description: JSON by default, set application/xml if XML.
defaultValue: None
types:
- <xref:str>
- name: key_extractors
defaultValue: None
return:
description: An instance of this model
exceptions:
- type: DeserializationError if something went wrong
- uid: azure.ai.ml.entities.ModelPackage.is_xml_model
name: is_xml_model
signature: is_xml_model()
- uid: azure.ai.ml.entities.ModelPackage.serialize
name: serialize
summary: 'Return the JSON that would be sent to azure from this model.
This is an alias to *as_dict(full_restapi_key_transformer, keep_readonly=False)*.
If you want XML serialization, you can pass the kwargs is_xml=True.'
signature: serialize(keep_readonly=False, **kwargs)
parameters:
- name: keep_readonly
description: If you want to serialize the readonly attributes
defaultValue: 'False'
types:
- <xref:bool>
return:
description: A dict JSON compatible object
types:
- <xref:dict>
- uid: azure.ai.ml.entities.ModelPackage.validate
name: validate
summary: Validate this model recursively and return a list of ValidationError.
signature: validate()
return:
description: A list of validation error
types:
- <xref:list>
attributes:
- uid: azure.ai.ml.entities.ModelPackage.base_path
name: base_path
summary: The base path of the resource.
return:
description: The base path of the resource.
types:
- <xref:str>
- uid: azure.ai.ml.entities.ModelPackage.creation_context
name: creation_context
summary: The creation context of the resource.
return:
description: The creation metadata for the resource.
types:
- <xref:typing.Optional>[<xref:azure.ai.ml.entities.SystemData>]
- uid: azure.ai.ml.entities.ModelPackage.id
name: id
summary: The resource ID.
return:
description: The global ID of the resource, an Azure Resource Manager (ARM) ID.
types:
- <xref:typing.Optional>[<xref:str>]