| @@ -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> | ||||