|
|
|
@@ -135,6 +135,14 @@ |
|
|
|
<label>模型版本</label> |
|
|
|
<input style="width: 45%;" id="version" name="Version" value="" readonly required maxlength="255"> |
|
|
|
</div> |
|
|
|
<div class="unite min_title inline field required"> |
|
|
|
<label>模型框架</label> |
|
|
|
<select id="Engine" class="ui search dropdown" placeholder="" style='width:385px' name="Engine"> |
|
|
|
<option name="Pytorch" value="0">Pytorch</option> |
|
|
|
<option name="TensorFlow" value="1">TensorFlow</option> |
|
|
|
<option name="MindSpore" value="2">MindSpore</option> |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
<div class="inline field"> |
|
|
|
<label>模型标签</label> |
|
|
|
<input style="width: 83%;margin-left: 7px;" id="label" name="Label" maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.label_place"}}'> |
|
|
|
@@ -166,7 +174,7 @@ |
|
|
|
let repoId = {{$repository}} |
|
|
|
const {_AppSubUrl, _StaticUrlPrefix, csrf} = window.config; |
|
|
|
$('input[name="_csrf"]').val(csrf) |
|
|
|
|
|
|
|
let modelData; |
|
|
|
function createModelName(){ |
|
|
|
let repoName = location.pathname.split('/')[2] |
|
|
|
let modelName = repoName + '_model_' + Math.random().toString(36).substr(2, 4) |
|
|
|
@@ -205,7 +213,21 @@ |
|
|
|
$(".ui.dropdown.selection.search.width70").addClass("loading") |
|
|
|
$('#choice_version').dropdown('clear') |
|
|
|
$("#job-version").empty() |
|
|
|
loadTrainVersion(value) |
|
|
|
loadTrainVersion(value) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
$('#choice_version').dropdown({ |
|
|
|
onChange:function(value){ |
|
|
|
console.log("model version:" + value); |
|
|
|
if(modelData != null){ |
|
|
|
for(var i=0; i < modelData.length;i++){ |
|
|
|
if(modelData[i].VersionName == value){ |
|
|
|
setEngine(modelData[i]) |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
@@ -245,7 +267,8 @@ |
|
|
|
let JobID = !value ?$('#choice_model input[name="JobId"]').val(): value |
|
|
|
$.get(`${repolink}/modelmanage/query_train_job_version?JobID=${JobID}`, (data) => { |
|
|
|
const n_length = data.length |
|
|
|
let train_html='' |
|
|
|
let train_html=''; |
|
|
|
modelData = data; |
|
|
|
for (let i=0;i<n_length;i++){ |
|
|
|
train_html += `<div class="item" data-value="${data[i].VersionName}">${data[i].VersionName}</div>` |
|
|
|
train_html += '</div>' |
|
|
|
@@ -259,9 +282,24 @@ |
|
|
|
} |
|
|
|
$('#choice_version .default.text').text(versionName) |
|
|
|
$('#choice_version input[name="VersionName"]').val(versionName) |
|
|
|
setEngine(data[0]) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
function setEngine(modelVersion){ |
|
|
|
if(modelVersion.EngineName != null){ |
|
|
|
srcEngine = modelVersion.EngineName.split('-')[0] |
|
|
|
if(srcEngine =='TensorFlow'){ |
|
|
|
$('#Engine').val(1) |
|
|
|
}else if(srcEngine =='MindSpore'){ |
|
|
|
$('#Engine').val(2) |
|
|
|
} |
|
|
|
$("#Engine").attr("disabled","disabled"); |
|
|
|
}else{ |
|
|
|
$("#Engine").removeAttr("disabled"); |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|