| @@ -87,6 +87,72 @@ | |||
| </div> | |||
| </form> --> | |||
| <!-- equal width --> | |||
| {{if eq .benchmarkMode "model"}} | |||
| <form class="ui form model_form" action="{{.Link}}" method="post"> | |||
| {{.CsrfTokenHtml}} | |||
| <input type="hidden" name="action" value="update"> | |||
| <div class="required unite min_title inline field"> | |||
| <label style="font-weight: normal;">评测场景</label> | |||
| <div class="ui blue small menu compact selectcloudbrain"> | |||
| <a class="item alogrithm_benchmark" href="{{.Link}}?benchmarkMode=alogrithm">算法评测</a> | |||
| <a class="active item model_benchmark" href="{{.Link}}?benchmarkMode=model">模型评测</a> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <div class="required unite min_title inline field"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label> | |||
| <input style="width: 80%;" name="display_job_name" id="trainjob_job_name" placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}" tabindex="3" autofocus required maxlength="254"> | |||
| </div> | |||
| <div class="unite min_title inline field"> | |||
| <label style="font-weight: normal;" for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}} </label> | |||
| <textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="254" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}} onchange="this.value=this.value.substring(0, 255)" onkeydown="this.value=this.value.substring(0, 255)" onkeyup="this.value=this.value.substring(0, 255)">{{.description}}</textarea> | |||
| </div> | |||
| <div class="required unite min_title inline field"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.gpu_type"}}</label> | |||
| <select id="cloudbrain_gpu_type" class="ui search dropdown width48" placeholder="选择GPU类型" name="gpu_type"> | |||
| {{range .benchmark_gpu_types}} | |||
| <option value="{{.Queue}}">{{.Value}}</option> | |||
| {{end}} | |||
| </select> | |||
| </div> | |||
| <div class="required unite min_title inline field"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.task_type"}}</label> | |||
| <select id="cloudbrain_job_type" class="ui search dropdown width48 job_type" placeholder="select {{.i18n.Tr "cloudbrain.task_type"}}" name="job_type"> | |||
| <option name="job_type" value="SNN4IMAGENET">SNN4IMAGENET</option> | |||
| <option name="job_type" value="BRAINSCORE">BRAINSCORE</option> | |||
| </select> | |||
| <span> | |||
| <i class="question circle icon link" data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}} data-position="right center" data-variation="mini"></i> | |||
| </span> | |||
| <a id="benchmark_model_example" href="https://git.openi.org.cn/yult/snn4imagenet">查看样例</a> | |||
| </div> | |||
| <div id="images-new-cb"> | |||
| </div> | |||
| {{template "custom/select_dataset_train" .}} | |||
| <div class="required unite min_title inline field" style="margin-top:2rem;"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label> | |||
| <select id="cloudbrain_resource_spec" class="ui search dropdown" placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' name="resource_spec_id"> | |||
| {{range .benchmark_resource_specs}} | |||
| <option name="resource_spec_id" value="{{.Id}}">{{$.i18n.Tr "cloudbrain.gpu_num"}}:{{.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{.MemMiB}},{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{.ShareMemMiB}}</option> | |||
| {{end}} | |||
| </select> | |||
| </div> | |||
| <div class="inline unite min_title field"> | |||
| <button class="ui create_train_job green button"> | |||
| {{.i18n.Tr "repo.cloudbrain.new"}} | |||
| </button> | |||
| <a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a> | |||
| </div> | |||
| </div> | |||
| </form> | |||
| {{else}} | |||
| <form class="ui form alogrithm_form" action="{{.Link}}" method="post"> | |||
| {{.CsrfTokenHtml}} | |||
| <input type="hidden" name="action" value="update"> | |||
| @@ -94,8 +160,8 @@ | |||
| <div class="required unite min_title inline field"> | |||
| <label style="font-weight: normal;">评测场景</label> | |||
| <div class="ui blue small menu compact selectcloudbrain"> | |||
| <a class="active item alogrithm_benchmark" href="{{.Link}}?type=alogrithm">算法评测</a> | |||
| <a class="item model_benchmark" href="{{.Link}}?type=model">模型评测</a> | |||
| <a class="active item alogrithm_benchmark" href="{{.Link}}?benchmarkMode=alogrithm">算法评测</a> | |||
| <a class="item model_benchmark" href="{{.Link}}?benchmarkMode=model">模型评测</a> | |||
| </div> | |||
| </div> | |||
| @@ -182,70 +248,7 @@ | |||
| <!-- 模态框 --> | |||
| </form> | |||
| <form class="ui form model_form" action="{{.Link}}" method="post" style="display: none;"> | |||
| {{.CsrfTokenHtml}} | |||
| <input type="hidden" name="action" value="update"> | |||
| <div class="required unite min_title inline field"> | |||
| <label style="font-weight: normal;">评测场景</label> | |||
| <div class="ui blue small menu compact selectcloudbrain"> | |||
| <a class="item alogrithm_benchmark" href="{{.Link}}?type=alogrithm">算法评测</a> | |||
| <a class="active item model_benchmark" href="{{.Link}}?type=model">模型评测</a> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <div class="required unite min_title inline field"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label> | |||
| <input style="width: 80%;" name="display_job_name" id="trainjob_job_name" placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}" tabindex="3" autofocus required maxlength="254"> | |||
| </div> | |||
| <div class="unite min_title inline field"> | |||
| <label style="font-weight: normal;" for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}} </label> | |||
| <textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="254" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}} onchange="this.value=this.value.substring(0, 255)" onkeydown="this.value=this.value.substring(0, 255)" onkeyup="this.value=this.value.substring(0, 255)">{{.description}}</textarea> | |||
| </div> | |||
| <div class="required unite min_title inline field"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.gpu_type"}}</label> | |||
| <select id="cloudbrain_gpu_type" class="ui search dropdown width48" placeholder="选择GPU类型" name="gpu_type"> | |||
| {{range .benchmark_gpu_types}} | |||
| <option value="{{.Queue}}">{{.Value}}</option> | |||
| {{end}} | |||
| </select> | |||
| </div> | |||
| <div class="required unite min_title inline field"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.task_type"}}</label> | |||
| <select id="cloudbrain_job_type" class="ui search dropdown width48 job_type" placeholder="select {{.i18n.Tr "cloudbrain.task_type"}}" name="job_type"> | |||
| <option name="job_type" value="SNN4IMAGENET">SNN4IMAGENET</option> | |||
| <option name="job_type" value="BRAINSCORE">BRAINSCORE</option> | |||
| </select> | |||
| <span> | |||
| <i class="question circle icon link" data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}} data-position="right center" data-variation="mini"></i> | |||
| </span> | |||
| <a id="benchmark_model_example" href="https://git.openi.org.cn/yult/snn4imagenet">查看样例</a> | |||
| </div> | |||
| <div id="images-new-cb-copy"> | |||
| </div> | |||
| {{template "custom/select_dataset_train" .}} | |||
| <div class="required unite min_title inline field" style="margin-top:2rem;"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label> | |||
| <select id="cloudbrain_resource_spec" class="ui search dropdown" placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' name="resource_spec_id"> | |||
| {{range .benchmark_resource_specs}} | |||
| <option name="resource_spec_id" value="{{.Id}}">{{$.i18n.Tr "cloudbrain.gpu_num"}}:{{.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{.MemMiB}},{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{.ShareMemMiB}}</option> | |||
| {{end}} | |||
| </select> | |||
| </div> | |||
| <div class="inline unite min_title field"> | |||
| <button class="ui create_train_job green button"> | |||
| {{.i18n.Tr "repo.cloudbrain.new"}} | |||
| </button> | |||
| <a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a> | |||
| </div> | |||
| </div> | |||
| </form> | |||
| {{end}} | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -253,7 +256,7 @@ | |||
| <script> | |||
| let repolink = {{.RepoLink}} | |||
| console.log({{$.jobType}}) | |||
| console.log({{$.benchmarkMode}}) | |||
| let url_href = window.location.pathname.split('create')[0] | |||
| $(".ui.button").attr('href',url_href) | |||
| @@ -276,17 +279,17 @@ | |||
| } | |||
| } | |||
| }) | |||
| console.log("==============") | |||
| const params = new URLSearchParams(location.search) | |||
| if(params.get('type')=='model'){ | |||
| console.log(2) | |||
| $('.model_form').css('display','block') | |||
| $('.alogrithm_form').css('display','none') | |||
| }else if(params.get('type')=='alogrithm'){ | |||
| console.log(1) | |||
| $('.model_form').css('display','none') | |||
| $('.alogrithm_form').css('display','block') | |||
| } | |||
| // console.log("==============") | |||
| // const params = new URLSearchParams(location.search) | |||
| // if(params.get('type')=='model'){ | |||
| // console.log(2) | |||
| // $('.model_form').css('display','block') | |||
| // $('.alogrithm_form').css('display','none') | |||
| // }else if(params.get('type')=='alogrithm'){ | |||
| // console.log(1) | |||
| // $('.model_form').css('display','none') | |||
| // $('.alogrithm_form').css('display','block') | |||
| // } | |||
| }) | |||
| function setChildType(){ | |||
| let type_id = $('#benchmark_types_id').val(); | |||