forked from docs/doc-exports
Reviewed-by: Jiang, Beibei <beibei.jiang@t-systems.com> Reviewed-by: Rechenburg, Matthias <matthias.rechenburg@t-systems.com> Co-authored-by: Lai, Weijian <laiweijian4@huawei.com> Co-committed-by: Lai, Weijian <laiweijian4@huawei.com>
291 lines
37 KiB
HTML
291 lines
37 KiB
HTML
<a name="modelarts_04_0207"></a><a name="modelarts_04_0207"></a>
|
|
|
|
<h1 class="topictitle1">Updating Service Configurations</h1>
|
|
<div id="body8662426"><p id="modelarts_04_0207__en-us_topic_0180094090_p14979252133019">You can use the API to update the configurations of a service object.</p>
|
|
<div class="section" id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_section59151611112217"><h4 class="sectiontitle">Sample Code</h4><p id="modelarts_04_0207__en-us_topic_0180094090_p12627161105020">In ModelArts notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see <a href="modelarts_04_0123.html">Session Authentication</a>.</p>
|
|
<ul id="modelarts_04_0207__en-us_topic_0180094090_ul47011028155110"><li id="modelarts_04_0207__en-us_topic_0180094090_li19701192819515"><strong id="modelarts_04_0207__b359686524">Method 1</strong>: Update the configurations of the service object created in <a href="modelarts_04_0201.html">Deploying a Real-Time Service</a>.<div class="codecoloring" codetype="Python" id="modelarts_04_0207__en-us_topic_0180094090_screen1833823445118"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span>
|
|
<span class="normal">8</span>
|
|
<span class="normal">9</span></pre></div></td><td class="code"><div><pre><span></span><span class="kn">from</span> <span class="nn">modelarts.session</span> <span class="kn">import</span> <span class="n">Session</span>
|
|
<span class="kn">from</span> <span class="nn">modelarts.model</span> <span class="kn">import</span> <span class="n">Predictor</span>
|
|
<span class="kn">from</span> <span class="nn">modelarts.config.model_config</span> <span class="kn">import</span> <span class="n">ServiceConfig</span>
|
|
<span class="n">session</span> <span class="o">=</span> <span class="n">Session</span><span class="p">()</span>
|
|
<span class="n">predictor_instance</span> <span class="o">=</span> <span class="n">Predictor</span><span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="n">service_id</span><span class="o">=</span><span class="s2">"input your service_id"</span><span class="p">)</span>
|
|
<span class="n">configs</span> <span class="o">=</span> <span class="p">[</span><span class="n">ServiceConfig</span><span class="p">(</span><span class="n">weight</span><span class="o">=</span><span class="s2">"100"</span><span class="p">,</span> <span class="n">instance_count</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">specification</span><span class="o">=</span><span class="s2">"modelarts.vm.cpu.2u"</span><span class="p">,</span><span class="n">model_id</span><span class="o">=</span><span class="s2">"input your model_id"</span><span class="p">)]</span>
|
|
<span class="n">service_config</span> <span class="o">=</span> <span class="n">predictor_instance</span><span class="o">.</span><span class="n">update_service_config</span><span class="p">(</span><span class="n">description</span><span class="o">=</span><span class="s2">"description"</span><span class="p">,</span>
|
|
<span class="n">status</span><span class="o">=</span><span class="s2">"running"</span><span class="p">,</span>
|
|
<span class="n">configs</span><span class="o">=</span><span class="n">configs</span><span class="p">)</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</li><li id="modelarts_04_0207__en-us_topic_0180094090_li197033113513"><strong id="modelarts_04_0207__b934619911538">Method 2</strong>: Update the configurations of the service object returned in <a href="modelarts_04_0206.html">Querying the List of Service Objects</a>.<div class="codecoloring" codetype="Python" id="modelarts_04_0207__en-us_topic_0180094090_screen6989241135110"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
|
|
<span class="normal"> 2</span>
|
|
<span class="normal"> 3</span>
|
|
<span class="normal"> 4</span>
|
|
<span class="normal"> 5</span>
|
|
<span class="normal"> 6</span>
|
|
<span class="normal"> 7</span>
|
|
<span class="normal"> 8</span>
|
|
<span class="normal"> 9</span>
|
|
<span class="normal">10</span></pre></div></td><td class="code"><div><pre><span></span><span class="kn">from</span> <span class="nn">modelarts.session</span> <span class="kn">import</span> <span class="n">Session</span>
|
|
<span class="kn">from</span> <span class="nn">modelarts.model</span> <span class="kn">import</span> <span class="n">Predictor</span>
|
|
<span class="kn">from</span> <span class="nn">modelarts.config.model_config</span> <span class="kn">import</span> <span class="n">ServiceConfig</span>
|
|
<span class="n">session</span> <span class="o">=</span> <span class="n">Session</span><span class="p">()</span>
|
|
<span class="n">predictor_object_list</span> <span class="o">=</span> <span class="n">Predictor</span><span class="o">.</span><span class="n">get_service_object_list</span><span class="p">(</span><span class="n">session</span><span class="p">)</span>
|
|
<span class="n">predictor_instance</span> <span class="o">=</span> <span class="n">predictor_object_list</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
|
|
<span class="n">configs</span> <span class="o">=</span> <span class="p">[</span><span class="n">ServiceConfig</span><span class="p">(</span><span class="n">weight</span><span class="o">=</span><span class="s2">"100"</span><span class="p">,</span> <span class="n">instance_count</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">specification</span><span class="o">=</span><span class="s2">"modelarts.vm.cpu.2u"</span><span class="p">,</span><span class="n">model_id</span><span class="o">=</span><span class="s2">"input your model_id"</span><span class="p">)]</span>
|
|
<span class="n">predictor_config</span> <span class="o">=</span> <span class="n">predictor_instance</span><span class="o">.</span><span class="n">update_service_config</span><span class="p">(</span><span class="n">description</span><span class="o">=</span><span class="s2">"description"</span><span class="p">,</span>
|
|
<span class="n">status</span><span class="o">=</span><span class="s2">"running"</span><span class="p">,</span>
|
|
<span class="n">configs</span><span class="o">=</span><span class="n">configs</span><span class="p">)</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_section14967645421"><h4 class="sectiontitle">Parameter Description</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_table1729519551521" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters for deploying <strong id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_b15674134912396">predictor</strong></caption><thead align="left"><tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row92951455227"><th align="left" class="cellrowborder" valign="top" width="12.121212121212121%" id="mcps1.3.3.2.2.5.1.1"><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1529512551427">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.121212121212121%" id="mcps1.3.3.2.2.5.1.2"><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1729513551121">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.171717171717173%" id="mcps1.3.3.2.2.5.1.3"><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1295155426">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="58.58585858585859%" id="mcps1.3.3.2.2.5.1.4"><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p42952551219">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row82951655722"><td class="cellrowborder" valign="top" width="12.121212121212121%" headers="mcps1.3.3.2.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p172953551525">description</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.121212121212121%" headers="mcps1.3.3.2.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p2295055426">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.171717171717173%" headers="mcps1.3.3.2.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p142951551123">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="58.58585858585859%" headers="mcps1.3.3.2.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p82952551624">Service description, which contains a maximum of 100 characters. If this parameter is not set, the service description is not updated.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row162950551829"><td class="cellrowborder" valign="top" width="12.121212121212121%" headers="mcps1.3.3.2.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p142951755223">status</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.121212121212121%" headers="mcps1.3.3.2.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p182951155226">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.171717171717173%" headers="mcps1.3.3.2.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1829511551824">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="58.58585858585859%" headers="mcps1.3.3.2.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p32956551022">Service status. The value can be <strong id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_b914811434213">running</strong> or <strong id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_b10150201417429">stopped</strong>. If this parameter is not set, the service status is not changed. <strong id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_b1179518203427">status</strong> and <strong id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_b4797220204212">configs</strong> cannot be modified at the same time. If both parameters exist, modify only the <strong id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_b11797152018421">status</strong> parameter.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row1629575514211"><td class="cellrowborder" valign="top" width="12.121212121212121%" headers="mcps1.3.3.2.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p19295255727">configs</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.121212121212121%" headers="mcps1.3.3.2.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p629510551028">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.171717171717173%" headers="mcps1.3.3.2.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p6295105518218"><strong id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_b249131144012">predictor configs</strong> and <strong id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_b64287151404">transformer configs</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="58.58585858585859%" headers="mcps1.3.3.2.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p629545516217">Service configurations. If this parameter is not set, the service is not updated. For details about how to generate <strong id="modelarts_04_0207__b229819273535">configs</strong>, see <a href="modelarts_04_0201.html">Deploying a Real-Time Service</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="note" id="modelarts_04_0207__note1644413562181"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="modelarts_04_0207__p14984155816184">The restrictions on updating service configurations are as follows:</p>
|
|
<ul id="modelarts_04_0207__ul1913844812019"><li id="modelarts_04_0207__li7404191132112">The specified <strong id="modelarts_04_0207__b1571113174556">status</strong> cannot be the same as the current service status.</li><li id="modelarts_04_0207__li713894811202">If the service status is <strong id="modelarts_04_0207__b09001036105518">deploying</strong>, <strong id="modelarts_04_0207__b10592439115519">stopping</strong>, or <strong id="modelarts_04_0207__b1061044118554">deleting</strong>, <strong id="modelarts_04_0207__b185371147125516">status</strong> cannot be set to <strong id="modelarts_04_0207__b201692053195519">running</strong> or <strong id="modelarts_04_0207__b11617575614">configs</strong> is not allowed to configure.</li><li id="modelarts_04_0207__li084112162217">If the service status is <strong id="modelarts_04_0207__b20977539205615">waiting</strong>, <strong id="modelarts_04_0207__b01581952205611">status</strong> cannot be set to <strong id="modelarts_04_0207__b1315895205612">running</strong>.</li><li id="modelarts_04_0207__li91381048162014">If the service status is <strong id="modelarts_04_0207__b1756641195716">concerning</strong>, <strong id="modelarts_04_0207__b175668111571">status</strong> cannot be set to <strong id="modelarts_04_0207__b1956711135711">running</strong>.</li></ul>
|
|
</div></div>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_table6841887256" frame="border" border="1" rules="all"><caption><b>Table 2 </b><strong id="modelarts_04_0207__en-us_topic_0180094090_b1929733975412">configs</strong> parameters of <strong id="modelarts_04_0207__en-us_topic_0180094090_b13297439135416">predictor</strong></caption><thead align="left"><tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row4846788252"><th align="left" class="cellrowborder" valign="top" width="13.861386138613863%" id="mcps1.3.4.2.5.1.1"><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p884819812515">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.871287128712872%" id="mcps1.3.4.2.5.1.2"><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1985013812252">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="13.861386138613863%" id="mcps1.3.4.2.5.1.3"><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1852188192520">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="59.4059405940594%" id="mcps1.3.4.2.5.1.4"><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p38538832514">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row1856380258"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1786010872513">model_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.4.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p386268152512">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1386419814252">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.4.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p9866118172511">Model ID. You can obtain the value by calling the API described in <a href="modelarts_04_0195.html">Obtaining the Model List</a> or from the ModelArts management console.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row1086798112511"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p986916812517">weight</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.4.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p687111819259">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p138731787259">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.4.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p19875118162511">Weight of traffic allocated to a model. This parameter is mandatory only when <strong id="modelarts_04_0207__en-us_topic_0180094090_b2237161111337">infer_type</strong> is set to <strong id="modelarts_04_0207__en-us_topic_0180094090_b1424010112338">real-time</strong>. The sum of multiple weights must be equal to 100. If multiple model versions are configured in a real-time service and different traffic weights are set, ModelArts continuously accesses the prediction API of the service and forwards prediction requests to the model instances of the corresponding versions based on the weights.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row1687613842514"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1187828182513">specification</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.4.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p38801282251">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p08821882254">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.4.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p13831001613">Resource flavor.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row988558102512"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1588814812519">instance_count</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.4.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p68902872512">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p18926812256">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.4.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p11894788252">Number of instances deployed in a model. The maximum number of instances is 5. To use more instances, submit a service ticket.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row208952088256"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p48972820252">envs</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.4.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1889910820252">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p119011483251">Map<String, String></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.4.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p590416818251">(Optional) Environment variable key-value pair required for running a model. By default, this parameter is left blank.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_table6420928063" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="modelarts_04_0207__en-us_topic_0180094090_b72887538018">configs</strong> parameters of <strong id="modelarts_04_0207__en-us_topic_0180094090_b3804551802">transformer</strong></caption><thead align="left"><tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row12420102810614"><th align="left" class="cellrowborder" valign="top" width="13.861386138613863%" id="mcps1.3.5.2.5.1.1"><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p164282280612">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.871287128712872%" id="mcps1.3.5.2.5.1.2"><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1442892817613">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="13.861386138613863%" id="mcps1.3.5.2.5.1.3"><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p942814289610">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="59.4059405940594%" id="mcps1.3.5.2.5.1.4"><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p342819281067">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row242862813615"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1042811281364">model_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.5.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1343542810611">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p643515281612">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.5.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p144351289614">Model ID. You can obtain the value by calling the API described in <a href="modelarts_04_0195.html">Obtaining the Model List</a> or from the ModelArts management console.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row644311283615"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1444316281614">specification</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.5.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1745022815613">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p124501281565">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.5.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1192195463517">Resource flavor. Currently, <strong id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_b63851524442">modelarts.vm.cpu.2u</strong> and <strong id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_b7385135234416">modelarts.vm.gpu.p4</strong> are available.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row104508285618"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p645020286620">instance_count</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.5.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p104501028868">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p545910281362">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.5.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p12442216495">Number of instances deployed in a model. The maximum number of instances is 5. To use more instances, submit a service ticket.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row245911284618"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p174598287617">envs</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.5.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p194590281468">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p204591928064">Map<String, String></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.5.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p14459202819615">(Optional) Environment variable key-value pair required for running a model. By default, this parameter is left blank.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row27917187920"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p27919181917">src_path</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.5.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p37921815919">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p2791818799">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.5.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p137911181899">OBS path of the input data of a batch job</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row924312220920"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p13250162218914">dest_path</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.5.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p152505229917">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p122507220919">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.5.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p647112917104">OBS path of the output data of a batch job</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row62328563176"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1823215618175">req_uri</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.5.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p16234125681718">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p18234205618176">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.5.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p323411565177">Inference API called in batch tasks. You must select an API URL from the <strong id="modelarts_04_0207__en-us_topic_0180094090_b937802373320">config.json</strong> file of the model for inference.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row285695891717"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1085645820173">mapping_type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.5.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p18856115816179">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p585614581175">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.5.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_p25161429175315">Mapping type of the input data. The value can be <strong id="modelarts_04_0207__en-us_topic_0180094090_b1213952916336">file</strong> or <strong id="modelarts_04_0207__en-us_topic_0180094090_b171401297337">csv</strong>.</p>
|
|
<ul id="modelarts_04_0207__en-us_topic_0180094090_ul155174325539"><li id="modelarts_04_0207__en-us_topic_0180094090_li18517937155319">If you select <strong id="modelarts_04_0207__en-us_topic_0180094090_b975383216331">file</strong>, each inference request corresponds to a file in the input data path. When this mode is used, <strong id="modelarts_04_0207__en-us_topic_0180094090_b675510328332">req_uri</strong> of a model can have only one input parameter and the type of this parameter is <strong id="modelarts_04_0207__en-us_topic_0180094090_b37562032143316">file</strong>.</li><li id="modelarts_04_0207__en-us_topic_0180094090_li1651773217531">If you select <strong id="modelarts_04_0207__en-us_topic_0180094090_b1292910580339">csv</strong>, each inference request corresponds to a row of data in the CSV file. When this mode is used, the files in the input data path can only be in CSV format and <strong id="modelarts_04_0207__en-us_topic_0180094090_b49307588331">mapping_rule</strong> needs to be configured to map the index of each parameter in the inference request body to the CSV file.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row158141118183"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p481416131817">mapping_rule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.5.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p188141813180">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.5.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p178147119189">Map</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.5.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p12814018180">Mapping between input parameters and CSV data. This parameter is mandatory only when <strong id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_b12273204174619">mapping_type</strong> is set to <strong id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_b1273204174616">csv</strong>. The mapping rule is similar to the definition of the input parameters in the <strong id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_b721898164610">config.json</strong> file. You only need to configure the index parameters under each parameter of the string, number, integer, or boolean type, and the value of this parameter to the values of the index parameters in the CSV file to send an inference request. Use commas (,) to separate multiple pieces of CSV data. The values of the index parameters start from <strong id="modelarts_04_0207__en-us_topic_0180094090_b54361942535">0</strong>. If the value of the index parameter is <strong id="modelarts_04_0207__en-us_topic_0180094090_b15211401535">-1</strong>, ignore this parameter.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_table55928961173927" frame="border" border="1" rules="all"><caption><b>Table 4 </b><strong id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_b55653575916">update_service_config</strong> response parameters</caption><thead align="left"><tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row40618446173927"><th align="left" class="cellrowborder" valign="top" width="13.861386138613863%" id="mcps1.3.6.2.5.1.1"><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1631242217407">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.871287128712872%" id="mcps1.3.6.2.5.1.2"><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p4623781817407">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="13.861386138613863%" id="mcps1.3.6.2.5.1.3"><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p5427574117407">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="59.4059405940594%" id="mcps1.3.6.2.5.1.4"><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p3425893817407">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row11062410173927"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.6.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p688954611624">error_code</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.6.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p2118234711624">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.6.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p3804851211624">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.6.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p1933601371920">Error code when the API call fails.</p>
|
|
<p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p6203060911624">This parameter is not included when the API call succeeds.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_row52351653173927"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.6.2.5.1.1 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p4368550411624">error_msg</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.6.2.5.1.2 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p4886491211624">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.6.2.5.1.3 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p6574380911624">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.6.2.5.1.4 "><p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p144278131194">Error message when the API call fails.</p>
|
|
<p id="modelarts_04_0207__en-us_topic_0180094090_en-us_topic_0160622887_p2364831411624">This parameter is not included when the API call succeeds.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="modelarts_04_0199.html">Service Management</a></div>
|
|
</div>
|
|
</div>
|
|
|