You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

new.tmpl 26 kB

3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. {{template "base/head" .}}
  2. <style>
  3. .unite{
  4. font-family: SourceHanSansSC-medium !important;
  5. color: rgba(16, 16, 16, 100) !important;
  6. }
  7. .title{
  8. font-size: 16px !important;
  9. padding-left: 3rem !important;
  10. }
  11. .min_title{
  12. font-size: 14px !important;
  13. margin-bottom: 2rem !important;
  14. }
  15. .width{
  16. width:100% !important;
  17. }
  18. .width80{
  19. width: 80.7% !important;
  20. }
  21. .width85 {
  22. width: 85% !important;
  23. margin-left: 10.5rem !important;
  24. align-items: center;
  25. }
  26. .width35{
  27. width: 35.5% !important;
  28. }
  29. .width48{
  30. width: 48.5% !important;
  31. }
  32. .nowrapx {
  33. white-space: nowrap !important;
  34. }
  35. </style>
  36. <div id="mask">
  37. <div id="loadingPage">
  38. <div class="rect1"></div>
  39. <div class="rect2"></div>
  40. <div class="rect3"></div>
  41. <div class="rect4"></div>
  42. <div class="rect5"></div>
  43. </div>
  44. </div>
  45. <div class="repository">
  46. {{template "repo/header" .}}
  47. <div class="ui container">
  48. {{template "base/alert" .}}
  49. <div class="cloudbrain-type" style="display: none;" data-cloudbrain-type="{{.datasetType}}" data-repo-link="{{.RepoLink}}" data-queue="{{.QueuesDetail}}" data-queue-start="{{.i18n.Tr "repo.wait_count_start"}}" data-queue-end="{{.i18n.Tr "repo.wait_count_end"}}"></div>
  50. <h4 class="ui top attached header">
  51. {{.i18n.Tr "repo.modelarts.train_job.new_infer"}}
  52. </h4>
  53. <div class="ui attached segment">
  54. <!-- equal width -->
  55. <form class="ui form" action="{{.Link}}" method="post">
  56. {{.CsrfTokenHtml}}
  57. <input type="hidden" name="action" value="update">
  58. <input type="hidden" id="ai_image_name" value="{{.image}}">
  59. <input type="hidden" id="ai_model_version" name="model_version" value="">
  60. <input type="hidden" id="failed_train_url" value="{{$.train_url}}">
  61. <input type="hidden" id="failed_model_name" value="{{$.model_name}}">
  62. <input type="hidden" id="failed_model_version" value="{{$.model_version}}">
  63. <input type="hidden" id="failed_ckpt_name" value="{{$.ckpt_name}}">
  64. <input type="hidden" id="failed_train_url" value="{{$.train_url}}">
  65. <h4 class="unite title ui header ">{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}:</h4>
  66. <div class="required min_title inline field">
  67. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.compute_resource"}}</label>
  68. <div class="ui blue mini menu compact selectcloudbrain">
  69. <a class="active item" href="{{.RepoLink}}/cloudbrain/inference-job/create">
  70. <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16"
  71. height="16">
  72. <path fill="none" d="M0 0h24v24H0z" />
  73. <path
  74. d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z" />
  75. </svg>
  76. CPU/GPU
  77. </a>
  78. <a class="item" href="{{.RepoLink}}/modelarts/inference-job/create">
  79. <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16"
  80. height="16">
  81. <path fill="none" d="M0 0h24v24H0z" />
  82. <path
  83. d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z" />
  84. </svg>
  85. Ascend NPU</a>
  86. </div>
  87. {{template "custom/wait_count_train" Dict "ctx" $ "type" .inference_gpu_types}}
  88. </div>
  89. <div class="required min_title inline field">
  90. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>
  91. <input style="width: 60%;" name="display_job_name" id="display_job_name" placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}" onkeyup="this.value=this.value.replace(/[, ]/g,'')" tabindex="3" autofocus required maxlength="64">
  92. <span class="tooltips" style="margin-left:11.5rem;display: block;">{{.i18n.Tr "cloudbrain.job_name_rule"}}</span>
  93. </div>
  94. <div class="unite min_title inline field">
  95. <label class="label-fix-width" style="font-weight: normal;" for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}}</label>
  96. {{if .description}}
  97. <textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="255" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}}>{{.description}}</textarea>
  98. {{else}}
  99. <textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="255" 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)"></textarea>
  100. {{end}}
  101. </div>
  102. <div class="ui divider"></div>
  103. <!-- 模型相关配置 -->
  104. <h4 class="unite title ui header ">{{.i18n.Tr "repo.modelarts.train_job.parameter_setting"}}:</h4>
  105. <div class="required unite inline min_title fields" style="width: 96.8%;">
  106. <div class="required eight wide field">
  107. <label style="font-weight: normal;white-space: nowrap;width: 210px;text-align: right;">{{.i18n.Tr "repo.modelarts.infer_job.select_model"}}</label>
  108. <div class="ui fluid search selection dropdown loading " id="select_model">
  109. {{if $.ckpt_name}}
  110. <input type="hidden" name="model_name" value="{{$.model_name}}" required>
  111. <div class="text">{{$.model_name}}</div>
  112. {{else}}
  113. <input type="hidden" name="model_name" required>
  114. <div class="text"></div>
  115. {{end}}
  116. <i class="dropdown icon"></i>
  117. <div class="menu" id="model_name">
  118. </div>
  119. </div>
  120. </div>
  121. <div class="three wide field">
  122. <div class="ui fluid search selection dropdown" id="select_model_version">
  123. {{if $.ckpt_name}}
  124. <input type="hidden" name="train_url" value="{{$.train_url}}" required>
  125. <div class="text">{{$.model_version}}</div>
  126. {{else}}
  127. <input type="hidden" name="train_url" required>
  128. <div class="text"></div>
  129. {{end}}
  130. <i class="dropdown icon"></i>
  131. <div class="menu" id="model_name_version">
  132. </div>
  133. </div>
  134. </div>
  135. <div class="five wide field">
  136. <div class="ui fluid search selection dropdown" id="select_model_checkpoint">
  137. {{if $.ckpt_name}}
  138. <input type="hidden" name="ckpt_name" value="{{$.ckpt_name}}" required>
  139. <div class="text">{{$.ckpt_name}}</div>
  140. {{else}}
  141. <input type="hidden" name="ckpt_name" required>
  142. <div class="text"></div>
  143. {{end}}
  144. <i class="dropdown icon"></i>
  145. <div class="menu" id="model_checkpoint">
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. <!-- AI引擎 -->
  151. <div id="images-new-cb">
  152. </div>
  153. <!-- 代码分支 -->
  154. <div class="required min_title inline field">
  155. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.code_version"}}</label>
  156. <select class="ui dropdown width48" id="code_version" name="branch_name">
  157. {{if .branch_name}}
  158. <option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option>
  159. {{range $k, $v :=.Branches}}
  160. {{ if ne $v $.branch_name }}
  161. <option name="branch_name" value="{{$v}}">{{$v}}</option>
  162. {{end}}
  163. {{end}}
  164. {{else}}
  165. <option name="branch_name" value="{{.branchName}}">{{.branchName}}</option>
  166. {{range $k, $v :=.Branches}}
  167. {{ if ne $v $.branchName }}
  168. <option name="branch_name" value="{{$v}}">{{$v}}</option>
  169. {{end}}
  170. {{end}}
  171. {{end}}
  172. </select>
  173. </div>
  174. <!-- GPU 卡的类型 -->
  175. <div class="required min_title inline field">
  176. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.gpu_type"}}</label>
  177. <select id="cloudbrain_gpu_type" class="ui search width48 dropdown gpu-type" placeholder="选择GPU类型"
  178. style='width:385px' name="gpu_type">
  179. {{if .gpu_type}}
  180. {{range .inference_gpu_types}}
  181. {{if eq $.gpu_type .Queue}}
  182. <option value="{{.Queue}}">{{.Value}}</option>
  183. {{end}}
  184. {{end}}
  185. {{range .inference_gpu_types}}
  186. {{if ne $.gpu_type .Queue}}
  187. <option value="{{.Queue}}">{{.Value}}</option>
  188. {{end}}
  189. {{end}}
  190. {{else}}
  191. {{range .inference_gpu_types}}
  192. <option value="{{.Queue}}">{{.Value}}</option>
  193. {{end}}
  194. {{end}}
  195. </select>
  196. </div>
  197. <!-- 数据集 -->
  198. {{template "custom/select_dataset_train" .}}
  199. <span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 1rem;"></span>
  200. <div class="inline min_title field required">
  201. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.start_file"}}</label>
  202. {{if .boot_file}}
  203. <input style="width: 48.5%;" name="boot_file" id="trainjob_boot_file" value="{{.boot_file}}" tabindex="3" autofocus required maxlength="255" >
  204. {{else}}
  205. <input style="width: 48.5%;" name="boot_file" id="trainjob_boot_file" value="" tabindex="3" autofocus required maxlength="255" >
  206. {{end}}
  207. <span >
  208. <i class="question circle icon" data-content={{.i18n.Tr "repo.modelarts.infer_job.boot_file_helper"}} data-position="top center" data-variation="inverted mini"></i>
  209. </span>
  210. <a href="https://git.openi.org.cn/OpenIOSSG/MNIST_PytorchExample_GPU/src/branch/master/inference.py" target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a>
  211. </div>
  212. <!-- 运行参数 -->
  213. <div class="inline min_title field">
  214. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label>
  215. <span id="add_run_para" style="cursor:pointer;color: rgba(3, 102, 214, 100);font-size: 14px;line-height: 26px;font-family: SourceHanSansSC-medium;"><i class="plus square outline icon"></i>{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}}</span>
  216. <input id="store_run_para" type="hidden" name="run_para_list">
  217. <div class="dynamic field" style="margin-top: 1rem;">
  218. {{if ne 0 (len .params)}}
  219. {{range $k ,$v := .params}}
  220. <div class="two fields width85" id="para{{$k}}">
  221. <div class="field">
  222. <input type="text" name="shipping_first-name" value={{$v.Label}} required>
  223. </div>
  224. <div class="field">
  225. <input type="text" name="shipping_last-name" value={{$v.Value}} required>
  226. </div>
  227. <span>
  228. <i class="trash icon"></i>
  229. </span>
  230. </div>
  231. {{end}}
  232. {{end}}
  233. </div>
  234. </div>
  235. <div class="required field " style="display: none;">
  236. <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.resource_pool"}}</label>
  237. <select class="ui dropdown" id="trainjob_resource_pool" style='width:385px' name="pool_id">
  238. {{range .resource_pools}}
  239. <option value="{{.ID}}">{{.Value}}</option>
  240. {{end}}
  241. </select>
  242. </div>
  243. <!-- 规格 -->
  244. <div class="required min_title inline field">
  245. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label>
  246. <select id="cloudbrain_resource_spec" class="ui search dropdown width80" placeholder="选择资源规格" name="resource_spec_id">
  247. {{if .resource_spec_id}}
  248. {{range .inference_resource_specs}}
  249. {{if eq $.resource_spec_id .Id}}
  250. <option value="{{.Id}}">GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option>
  251. {{end}}
  252. {{end}}
  253. {{range .inference_resource_specs}}
  254. {{if ne $.resource_spec_id .Id}}
  255. <option value="{{.Id}}">GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option>
  256. {{end}}
  257. {{end}}
  258. {{else}}
  259. {{range .inference_resource_specs}}
  260. <option name="resource_spec_id" value="{{.Id}}">
  261. GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option>
  262. {{end}}
  263. {{end}}
  264. </select>
  265. </div>
  266. <!-- 表单操作 -->
  267. <div class="inline min_title field">
  268. <label class="label-fix-width" style="font-weight: normal;"></label>
  269. <button class="ui create_train_job green button">
  270. {{.i18n.Tr "repo.cloudbrain.new"}}
  271. </button>
  272. <a class="ui button" href="{{.RepoLink}}/modelarts/inference-job">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a>
  273. </div>
  274. <!-- 模态框 -->
  275. </form>
  276. </div>
  277. </div>
  278. </div>
  279. {{template "base/footer" .}}
  280. <script>
  281. const RepoLink = {{.RepoLink}}
  282. let nameMap,nameList
  283. let faildModelName = $('#failed_model_name').val()
  284. // 获取模型列表和模型名称对应的模型版本
  285. $.get(`${RepoLink}/modelmanage/query_model_for_predict?type=0`, (data) => {
  286. modelVersion()
  287. modelCkpt()
  288. nameMap = data.nameMap
  289. nameList = data.nameList
  290. let html = ''
  291. nameList.forEach(element => {
  292. html += `<div class="item" data-value=${element}>${element}</div>`
  293. });
  294. if(nameList.length!==0){
  295. const initModelVersion = nameMap[nameList[0]][0]
  296. const initTrainTaskInfo = JSON.parse(initModelVersion.TrainTaskInfo)
  297. $('#model_name').append(html)
  298. if(faildModelName){
  299. $("#select_model").dropdown('set text',faildModelName)
  300. $("#select_model").dropdown('set value',faildModelName,faildModelName)
  301. }else{
  302. $("#select_model").dropdown('set text',nameList[0])
  303. $("#select_model").dropdown('set value',nameList[0],nameList[0])
  304. }
  305. }
  306. $('#select_model').removeClass("loading")
  307. })
  308. // 根据选中的模型名称获取相应的模型版本
  309. function modelVersion(){
  310. let faildModelVersion = $('#failed_model_version').val()
  311. let faildTrainUrl = $('#failed_train_url').val()
  312. $('#select_model').dropdown({
  313. onChange: function(value, text, $selectedItem) {
  314. $("#select_model_version").addClass("loading")
  315. $('#model_name_version').empty()
  316. let html = ''
  317. nameMap[value].forEach(element => {
  318. let {TrainTaskInfo} = element
  319. TrainTaskInfo = JSON.parse(TrainTaskInfo)
  320. html += `<div class="item" data-label="${element.Label}" data-id="${element.ID}" data-value="${element.Path}">${element.Version}</div>`
  321. });
  322. $('#model_name_version').append(html)
  323. $("#select_model_version").removeClass("loading")
  324. const initVersionText = $('#model_name_version div.item:first-child').text()
  325. const initVersionValue = $('#model_name_version div.item:first-child').data('value')
  326. if(faildModelVersion&&faildTrainUrl){
  327. console.log("-0-0-0-0-0-")
  328. $("#select_model_version").dropdown('set text',faildModelVersion)
  329. $("#select_model_version").dropdown('set value',faildTrainUrl,faildModelVersion,$('#model_name_version div.item:first-child'))
  330. }else{
  331. $("#select_model_version").dropdown('set text',initVersionText)
  332. $("#select_model_version").dropdown('set value',initVersionValue,initVersionText,$('#model_name_version div.item:first-child'))
  333. }
  334. }
  335. })
  336. }
  337. // 根据选中的模型版本获取相应的模型权重文件
  338. function modelCkpt(){
  339. let faildCkptName = $('#failed_ckpt_name').val()
  340. $('#select_model_version').dropdown({
  341. onChange: function(value, text, $selectedItem) {
  342. const dataID = $selectedItem[0].getAttribute("data-id")
  343. const label = $selectedItem[0].getAttribute("data-label")
  344. $("#select_model_checkpoint").addClass("loading")
  345. $("#model_checkpoint").empty()
  346. let html = ''
  347. loadCheckpointList(dataID).then((res)=>{
  348. res.forEach(element => {
  349. const ckptSuffix = element.FileName.split(".")
  350. const loadCheckpointFile = ['ckpt','pb','h5','json','pkl','pth','t7']
  351. if(!element.IsDir && loadCheckpointFile.includes(ckptSuffix[ckptSuffix.length-1])){
  352. html += `<div class="item" data-value=${element.FileName}>${element.FileName}</div>`
  353. }
  354. })
  355. $('#model_checkpoint').append(html)
  356. $("#select_model_checkpoint").removeClass("loading")
  357. const initVersionText = $('#model_checkpoint div.item:first-child').text()
  358. const initVersionValue = $('#model_checkpoint div.item:first-child').data('value')
  359. if(faildCkptName){
  360. $("#select_model_checkpoint").dropdown('set text',faildCkptName)
  361. $("#select_model_checkpoint").dropdown('set value',faildCkptName,faildCkptName,$('#model_name_version div.item:first-child'))
  362. }else{
  363. $("#select_model_checkpoint").dropdown('set text',initVersionText)
  364. $("#select_model_checkpoint").dropdown('set value',initVersionValue,initVersionText,$('#model_name_version div.item:first-child'))
  365. }
  366. })
  367. $("input#ai_model_version").val(text)
  368. $("input#ai_model_label").val(label)
  369. }
  370. })
  371. }
  372. function loadCheckpointList(value){
  373. return new Promise((resolve,reject)=>{
  374. $.get(`${RepoLink}/modelmanage/query_modelfile_for_predict`,{ID:value}, (data) => {
  375. resolve(data)
  376. })
  377. })
  378. }
  379. $('.question.circle.icon').hover(function(){
  380. $(this).popup('show')
  381. });
  382. // 参数增加、删除、修改、保存
  383. function Add_parameter(i){
  384. value = '<div class="two fields width85" id= "para'+ i +'">' +
  385. '<div class="field">' +
  386. '<input type="text" name="shipping_first-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}> ' +
  387. '</div> ' +
  388. '<div class="field"> ' +
  389. '<input type="text" name="shipping_last-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}>' +
  390. '</div>'+
  391. '<span>' +
  392. '<i class="trash icon">' +
  393. '</i>' +
  394. '</span>' +
  395. '</div>'
  396. $(".dynamic.field").append(value)
  397. }
  398. $('#add_run_para').click(function(){
  399. var len = $(".dynamic.field .two.fields").length
  400. Add_parameter(len)
  401. });
  402. $(".dynamic.field").on("click",".trash.icon", function() {
  403. var index = $(this).parent().parent().index()
  404. $(this).parent().parent().remove()
  405. var len = $(".dynamic.field .two.fields").length
  406. $(".dynamic.field .two.fields").each(function(){
  407. var cur_index = $(this).index()
  408. $(this).attr('id', 'para' + cur_index)
  409. })
  410. });
  411. function send_run_para(){
  412. var run_parameters = []
  413. var msg = {}
  414. $(".dynamic.field .two.fields").each(function(){
  415. var para_name = $(this).find('input[name=shipping_first-name]').val()
  416. var para_value = $(this).find('input[name=shipping_last-name]').val()
  417. run_parameters.push({"label": para_name, "value": para_value})
  418. })
  419. msg["parameter"] = run_parameters
  420. msg = JSON.stringify(msg)
  421. $('#store_run_para').val(msg)
  422. }
  423. function validate(){
  424. $('.ui.form')
  425. .form({
  426. on: 'blur',
  427. fields: {
  428. boot_file: {
  429. identifier : 'boot_file',
  430. rules: [
  431. {
  432. type: 'regExp[/.+\.py$/g]',
  433. }
  434. ]
  435. },
  436. display_job_name:{
  437. identifier : 'display_job_name',
  438. rules: [
  439. {
  440. type: 'regExp[/^[a-zA-Z0-9-_]{1,64}[^-]$/]',
  441. }
  442. ]
  443. },
  444. attachment:{
  445. identifier : 'attachment',
  446. rules: [
  447. {
  448. type: 'empty',
  449. }
  450. ]
  451. },
  452. model_name:{
  453. identifier : 'model_name',
  454. rules: [
  455. {
  456. type: 'empty',
  457. }
  458. ]
  459. },
  460. train_url:{
  461. identifier : 'train_url',
  462. rules: [
  463. {
  464. type: 'empty',
  465. }
  466. ]
  467. },
  468. ckpt_name:{
  469. identifier : 'ckpt_name',
  470. rules: [
  471. {
  472. type: 'empty',
  473. }
  474. ]
  475. }
  476. },
  477. onSuccess: function(){
  478. document.getElementById("mask").style.display = "block"
  479. },
  480. onFailure: function(e){
  481. return false;
  482. }
  483. })
  484. }
  485. document.onreadystatechange = function() {
  486. if (document.readyState === "complete") {
  487. document.getElementById("mask").style.display = "none"
  488. }
  489. }
  490. $('.ui.create_train_job.green.button').click(function(e) {
  491. send_run_para()
  492. validate()
  493. })
  494. </script>