| @@ -110,13 +110,6 @@ | |||
| <span class="fitted" | |||
| style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span> | |||
| </a> | |||
| {{else if eq .JobType "MODELSAFETY"}} | |||
| <a class="title" | |||
| href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/modelsafety/{{$JobID}}/show" | |||
| title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px"> | |||
| <span class="fitted" | |||
| style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span> | |||
| </a> | |||
| {{else if eq .JobType "INFERENCE"}} | |||
| <a class="title" | |||
| href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/{{if eq .Cloudbrain.Type 1}}modelarts{{else if eq .Cloudbrain.Type 0}}cloudbrain{{end}}/inference-job/{{$JobID}}" | |||
| @@ -131,7 +124,7 @@ | |||
| <span class="fitted" | |||
| style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span> | |||
| </a> | |||
| {{else if eq .JobType "BENCHMARK"}} | |||
| {{else if eq .JobType "BENCHMARK" "MODELSAFETY"}} | |||
| <a class="title" | |||
| href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/cloudbrain/benchmark/{{$JobID}}" | |||
| title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px"> | |||
| @@ -148,7 +141,7 @@ | |||
| <div class="two wide column text center nowrap" | |||
| style="width: 6% !important;"> | |||
| <span class="job-status" id="{{$JobID}}" | |||
| data-repopath='{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "DEBUG"}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{else if eq .JobType "INFERENCE"}}/modelarts/inference-job{{else if eq .JobType "TRAIN"}}/modelarts/train-job{{else if eq .JobType "BENCHMARK"}}/cloudbrain{{end}}' | |||
| data-repopath='{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "DEBUG"}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{else if eq .JobType "INFERENCE"}}/modelarts/inference-job{{else if eq .JobType "TRAIN"}}/modelarts/train-job{{else if eq .JobType "BENCHMARK" "MODELSAFETY"}}/cloudbrain{{end}}' | |||
| data-jobid="{{$JobID}}" data-version="{{.VersionName}}"> | |||
| <span><i id="{{$JobID}}-icon" style="vertical-align: middle;" | |||
| class="{{.Status}}"></i><span id="{{$JobID}}-text" | |||
| @@ -99,18 +99,11 @@ | |||
| {{range .Tasks}} | |||
| <div class="ui grid stackable item"> | |||
| <div class="row"> | |||
| <!-- 任务名 --> | |||
| <div class="three wide column padding0" style="width: 18% !important;"> | |||
| {{if eq .JobType "MODELSAFETY"}} | |||
| <a class="title" href="{{$.RepoLink}}/modelsafety/{{.Cloudbrain.ID}}/show" title="{{.DisplayJobName}}" style="font-size: 14px;"> | |||
| <span class="fitted" style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span> | |||
| </a> | |||
| {{else}} | |||
| <a class="title" href="{{$.Link}}/{{.Cloudbrain.ID}}" title="{{.DisplayJobName}}" style="font-size: 14px;"> | |||
| <span class="fitted" style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span> | |||
| </a> | |||
| {{end}} | |||
| </div> | |||
| <!-- 任务状态 --> | |||
| <div class="two wide column text center padding0" style="width: 10.5% !important;"> | |||
| @@ -340,47 +340,76 @@ | |||
| .form({ | |||
| on: 'blur', | |||
| fields: { | |||
| model_name:{ | |||
| identifier : 'model_name', | |||
| boot_file: { | |||
| identifier: "boot_file", | |||
| rules: [ | |||
| { | |||
| type: 'empty', | |||
| } | |||
| ] | |||
| { | |||
| type: "regExp[/.+.py$/g]", | |||
| }, | |||
| ], | |||
| }, | |||
| train_url:{ | |||
| identifier : 'train_url', | |||
| job_name: { | |||
| identifier: "job_name", | |||
| rules: [ | |||
| { | |||
| type: 'empty', | |||
| } | |||
| ] | |||
| { | |||
| type: "regExp[/^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/]", | |||
| }, | |||
| ], | |||
| }, | |||
| ckpt_name:{ | |||
| identifier : 'ckpt_name', | |||
| display_job_name: { | |||
| identifier: "display_job_name", | |||
| rules: [ | |||
| { | |||
| type: 'empty', | |||
| } | |||
| ] | |||
| { | |||
| type: "regExp[/^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/]", | |||
| }, | |||
| ], | |||
| }, | |||
| attachment: { | |||
| identifier: "attachment", | |||
| rules: [ | |||
| { | |||
| type: "empty", | |||
| }, | |||
| ], | |||
| }, | |||
| spec_id: { | |||
| identifier: "spec_id", | |||
| rules: [{ type: "empty" }], | |||
| }, | |||
| evaluation_index:{ | |||
| identifier: 'evaluation_index', | |||
| rules: [{ type: 'empty', } ] | |||
| }, | |||
| model_name:{ | |||
| identifier: 'model_name', | |||
| rules: [{ type: 'empty', } ] | |||
| }, | |||
| train_url:{ | |||
| identifier: 'train_url', | |||
| rules: [{ type: 'empty', }] | |||
| }, | |||
| ckpt_name:{ | |||
| identifier: 'ckpt_name', | |||
| rules: [{ type: 'empty', }] | |||
| }, | |||
| }, | |||
| onSuccess: function () { | |||
| // $('.ui.page.dimmer').dimmer('show') | |||
| document.getElementById("mask").style.display = "block"; | |||
| isValidate = true; | |||
| }, | |||
| onFailure: function (e) { | |||
| document.getElementById("mask").style.display = "none"; | |||
| isValidate = false; | |||
| createFlag = false; | |||
| return false; | |||
| } | |||
| }) | |||
| } | |||
| // validate() | |||
| validate(); | |||
| $('.ui.create_train_job.green.button').click(function (e) { | |||
| validate() | |||
| }) | |||
| validate(); | |||
| }); | |||
| ;(function() { | |||
| var SPECS = {{ .benchmark_specs }} || {{ .Specs }}; | |||
| @@ -220,7 +220,7 @@ | |||
| <div class="active section" vfield="DisplayJobName"></div> | |||
| </div> | |||
| </h4> | |||
| <div class="ui accordion border-according" id="accordion" data-repopath="{{$.RepoRelPath}}/modelsafety" data-jobid="" vdatajobid="ID" data-version=""> | |||
| <div class="ui accordion border-according" id="accordion" data-repopath="{{$.RepoRelPath}}/cloudbrain" data-jobid="" vdatajobid="ID" data-version=""> | |||
| <input type="hidden" id="jobId_input" name="jobId_input" value="" vvalue="JobID"> | |||
| <div class="active title padding0"> | |||
| <div class="according-panel-heading"> | |||
| @@ -752,7 +752,6 @@ | |||
| } | |||
| ]; | |||
| } | |||
| console.log(option); | |||
| chartHandle.setOption(option); | |||
| window.addEventListener('resize', chartHandle.resize); | |||
| } | |||
| @@ -804,7 +803,7 @@ | |||
| var resultData; | |||
| function initData() { | |||
| $.ajax({ | |||
| url: window.location.href.replace('/show', ''), | |||
| url: window.location.href.replace('cloudbrain/benchmark', 'modelsafety'), | |||
| type: "get", | |||
| data: {}, | |||
| contentType: "application/json; charset=utf-8", | |||
| @@ -85,20 +85,13 @@ | |||
| <span class="fitted" | |||
| style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span> | |||
| </a> | |||
| {{else if or (eq .JobType "SNN4IMAGENET") (eq .JobType "BRAINSCORE")}} | |||
| {{else if (eq .JobType "SNN4IMAGENET" "BRAINSCORE")}} | |||
| <a class="title" | |||
| href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/cloudbrain/benchmark/{{$JobID}}" | |||
| title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px"> | |||
| <span class="fitted" | |||
| style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span> | |||
| </a> | |||
| {{else if eq .JobType "MODELSAFETY"}} | |||
| <a class="title" | |||
| href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/modelsafety/{{$JobID}}/show" | |||
| title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px"> | |||
| <span class="fitted" | |||
| style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span> | |||
| </a> | |||
| {{else if eq .JobType "INFERENCE"}} | |||
| <a class="title" | |||
| href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/{{if eq .Cloudbrain.Type 1}}modelarts{{else if eq .Cloudbrain.Type 0}}cloudbrain{{end}}/inference-job/{{$JobID}}" | |||
| @@ -113,7 +106,7 @@ | |||
| <span class="fitted" | |||
| style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span> | |||
| </a> | |||
| {{else if eq .JobType "BENCHMARK"}} | |||
| {{else if eq .JobType "BENCHMARK" "MODELSAFETY"}} | |||
| <a class="title" | |||
| href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/cloudbrain/benchmark/{{$JobID}}" | |||
| title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px"> | |||
| @@ -130,7 +123,7 @@ | |||
| <div class="two wide column text center nowrap" | |||
| style="width: 8% !important;"> | |||
| <span class="job-status" id="{{$JobID}}" | |||
| data-repopath='{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "DEBUG"}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{else if eq .JobType "INFERENCE"}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts{{end}}/inference-job{{else if eq .JobType "TRAIN"}}{{if eq .ComputeResource "NPU"}}/modelarts/train-job{{else}}/cloudbrain/train-job{{end}}{{else if eq .JobType "BENCHMARK"}}/cloudbrain{{end}}' | |||
| data-repopath='{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "DEBUG"}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{else if eq .JobType "INFERENCE"}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts{{end}}/inference-job{{else if eq .JobType "TRAIN"}}{{if eq .ComputeResource "NPU"}}/modelarts/train-job{{else}}/cloudbrain/train-job{{end}}{{else if eq .JobType "BENCHMARK" "MODELSAFETY"}}/cloudbrain{{end}}' | |||
| data-jobid="{{$JobID}}" data-version="{{.VersionName}}"> | |||
| <span><i id="{{$JobID}}-icon" style="vertical-align: middle;" | |||
| class="{{.Status}}"></i><span id="{{$JobID}}-text" | |||
| @@ -121,6 +121,7 @@ | |||
| }, | |||
| onFailure: function (e) { | |||
| isValidate = false; | |||
| createFlag = false; | |||
| return false; | |||
| }, | |||
| }); | |||
| @@ -87,6 +87,10 @@ export const getRewardPointRecordInfo = (record) => { | |||
| if (record.SourceType === 'ADMIN_OPERATE') { | |||
| out.remark = record.Remark; | |||
| } else if (record.SourceType === 'ACCOMPLISH_TASK') { | |||
| if (record.Action?.Cloudbrain?.JobType === 'MODELSAFETY') { | |||
| record.Action.Cloudbrain.oJobType = 'MODELSAFETY'; | |||
| record.Action.Cloudbrain.JobType = 'BENCHMARK'; | |||
| } | |||
| switch (record?.Action?.TaskType) { | |||
| case 'CreatePublicRepo': // 创建公开项目 - 创建了项目OpenI/aiforge | |||
| out.remark = `${i18n.t('createdRepository')}<a href="${record.Action.RepoLink}" rel="nofollow">${record.Action.ShortRepoFullDisplayName}</a>`; | |||