Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.7.1
zouap 3 years ago
parent
commit
beb168edd0
1 changed files with 24 additions and 7 deletions
  1. +24
    -7
      templates/repo/modelmanage/convertIndex.tmpl

+ 24
- 7
templates/repo/modelmanage/convertIndex.tmpl View File

@@ -431,19 +431,36 @@
$('#choice_version input[name="ModelVersion"]').val(versionList[0].ID) $('#choice_version input[name="ModelVersion"]').val(versionList[0].ID)
loadModelFile(versionList[0].ID); loadModelFile(versionList[0].ID);
} }
setEngineValue(value);
} }
function setEngineValue(value){ function setEngineValue(value){
$('#SrcEngine').dropdown('clear'); $('#SrcEngine').dropdown('clear');
console.log("setEngineValue value=" + value); console.log("setEngineValue value=" + value);
let html = "" let html = ""
if(value ==null || value ==""){
html +="<option name=\"Pytorch\" value=\"0\">Pytorch</option>";
html +="<option name=\"TensorFlow\" value=\"1\">TensorFlow</option>";
html +="<option name=\"MindSpore\" value=\"2\">MindSpore</option>";
}else{

html +="<option name=\"Pytorch\" " + getSelected(0,value) + " value=\"0\">Pytorch</option>";
html +="<option name=\"TensorFlow\" " + getSelected(1,value) + " value=\"1\">TensorFlow</option>";
html +="<option name=\"MindSpore\" " + getSelected(2,value) + " value=\"2\">MindSpore</option>";
$('#SrcEngine').html(html);
}
function getSelected(engineOption, modelName){
if(modelName ==null || modelName ==""){
return "";
} }

let nameMap = modelData.nameMap
let versionList = nameMap[modelName]
if(versionList != null && versionList.length >0){
if(versionList[0].Engine == engineOption){
return "selected=\"selected\"";
}else{
if(versionList[0].Engine==122 && engineOption==2){
return "selected=\"selected\"";
}
if(versionList[0].Engine==121 && engineOption==1){
return "selected=\"selected\"";
}
}
}
return "";
} }
</script> </script>



Loading…
Cancel
Save