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 25 kB

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