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 30 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
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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  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. .width81 {
  16. margin-left: 1.5rem;
  17. width: 81% !important;
  18. }
  19. .width48 {
  20. width: 48.5% !important;
  21. }
  22. .nowrapx {
  23. white-space: nowrap !important;
  24. }
  25. </style>
  26. {{template "custom/global_mask" .}}
  27. <div class="repository">
  28. {{template "repo/header" .}}
  29. <div class="ui container">
  30. {{if eq .NotStopTaskCount 0}}
  31. {{template "base/alert" .}}
  32. {{end}}
  33. {{template "custom/alert_cb" .}}
  34. <h4 class="ui top attached header">
  35. {{.i18n.Tr "repo.modelarts.evaluate_job.new_job"}}
  36. </h4>
  37. <div class="ui attached segment">
  38. <input type="hidden" name="benchmarkMode" value="{{.benchmarkMode}}">
  39. {{if eq .benchmarkMode "model"}}
  40. <form id="form_id" class="ui form model_form" action="{{.Link}}?benchmarkMode=model" method="post">
  41. {{.CsrfTokenHtml}}
  42. <input type="hidden" name="action" value="update">
  43. <div class="required min_title inline field">
  44. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_scenes"}}</label>
  45. <div class="ui blue small menu compact selectcloudbrain">
  46. <a class="item alogrithm_benchmark"
  47. href="{{.Link}}?benchmarkMode=alogrithm">{{.i18n.Tr "repo.cloudbrain.benchmark.algorithm"}}</a>
  48. <a class="active item model_benchmark"
  49. href="{{.Link}}?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a>
  50. <a class="item aisafety_benchmark"
  51. href="{{.RepoLink}}/modelsafety/create_gpu">模型安全评测</a>
  52. </div>
  53. </div>
  54. <div>
  55. <div class="min_title inline field" style="margin-top:-10px;">
  56. <label class="label-fix-width" style="font-weight: normal;"></label>
  57. {{template "custom/task_wait_count" .}}
  58. </div>
  59. <div class="required min_title inline field">
  60. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>
  61. <input style="width: 80%;" name="display_job_name" id="trainjob_job_name"
  62. placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}"
  63. tabindex="3" autofocus required maxlength="36">
  64. <span class="tooltips" style="display: block;margin-left:11.5rem;">{{.i18n.Tr "repo.cloudbrain_jobname_err"}}</span>
  65. </div>
  66. <div class="required min_title inline field">
  67. <label class="label-fix-width" style="font-weight: normal;"
  68. for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}}</label>
  69. <textarea style="width: 80%;" id="description" name="description" rows="3" required
  70. maxlength="254" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}}
  71. onchange="this.value=this.value.substring(0, 255)"
  72. onkeydown="this.value=this.value.substring(0, 255)"
  73. onkeyup="this.value=this.value.substring(0, 255)">{{.description}}</textarea>
  74. </div>
  75. <!--<div class="required min_title inline field">
  76. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.gpu_type"}}</label>
  77. <select id="cloudbrain_gpu_type" class="ui search dropdown width48" placeholder="选择GPU类型"
  78. name="gpu_type">
  79. {{range .benchmark_gpu_types}}
  80. <option value="{{.Queue}}">{{.Value}}</option>
  81. {{end}}
  82. </select>
  83. </div>-->
  84. <div class="required unite min_title two inline fields" style="margin-left: 80px;">
  85. <div class="required ten wide field" style="width: 26.5% !important;">
  86. <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.task_type"}}</label>&nbsp;
  87. <select id="cloudbrain_job_type" class="ui search dropdown job_type"
  88. placeholder="select {{.i18n.Tr "cloudbrain.task_type"}}" name="job_type">
  89. <option value="SNN4IMAGENET">SNN4IMAGENET</option>
  90. <option value="BRAINSCORE">BRAINSCORE</option>
  91. </select>
  92. </div>
  93. <div class="required six widde field" id="brainscore_child_type"
  94. style="width: 15% !important;display: none;">
  95. <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.brain_area"}}</label>
  96. <select class="ui search dropdown" placeholder="select {{.i18n.Tr "cloudbrain.brain_area"}}"
  97. name="benchmark_child_types_id">
  98. <option value="0">V1</option>
  99. <option value="1">V2</option>
  100. <option value="2">V4</option>
  101. <option value="3">IT</option>
  102. </select>
  103. </div>
  104. <span>
  105. <i class="question circle icon link"
  106. data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}}
  107. data-position="right center" data-variation="mini"></i>
  108. </span>
  109. <a id="benchmark_model_example" href="https://openi.pcl.ac.cn/BDIP/snn4imagenet"
  110. target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a>
  111. </div>
  112. <div id="images-new-cb">
  113. </div>
  114. {{template "custom/select_dataset_train" .}}
  115. <!--<div class="required min_title inline field" style="margin-top:2rem;">
  116. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label>
  117. <select id="cloudbrain_resource_spec" class="ui search dropdown"
  118. placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px'
  119. name="resource_spec_id">
  120. {{range .benchmark_resource_specs}}
  121. <option name="resource_spec_id" value="{{.Id}}">
  122. {{$.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}}
  123. </option>
  124. {{end}}
  125. </select>
  126. </div>-->
  127. <div class="required min_title inline field" style="margin-top:2rem;">
  128. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label>
  129. <select id="__specs__" class="ui search dropdown width48"
  130. placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' ovalue="{{.spec_id}}"
  131. {{if .CloudBrainPaySwitch}}blance="{{.PointAccount.Balance}}"{{end}}
  132. name="spec_id">
  133. </select>
  134. <span><i class="question circle icon link"></i></span>
  135. <a href="{{AppSubUrl}}/resource_desc" target="_blank">{{.i18n.Tr "custom.resource_description"}}</a>
  136. {{if .CloudBrainPaySwitch}}
  137. <div class="cloudbrain_resource_spec_blance_tip width48" style="padding:0 5px;margin:6px 0;margin-left:155px;font-size:12px;">
  138. <span>{{$.i18n.Tr "points.balance_of_points"}}<span style="color:red;margin: 0 3px">{{.PointAccount.Balance}}</span>{{$.i18n.Tr "points.points"}}</span><span>{{$.i18n.Tr "points.expected_time"}}<span style="color:red;margin: 0 3px" class="can-use-time"></span>{{$.i18n.Tr "points.hours"}}</span>
  139. <span style="float:right;">
  140. <i class="question circle icon link" data-position="right center" data-variation="mini"></i>
  141. <a href="{{AppSubUrl}}/reward/point/rule" target="_blank">{{$.i18n.Tr "points.points_acquisition_instructions"}}</a>
  142. </span>
  143. </div>
  144. {{end}}
  145. </div>
  146. <div class="inline min_title field">
  147. <label class="label-fix-width" style="font-weight: normal;"></label>
  148. <button class="ui create_train_job green button {{if eq .NotStopTaskCount 1}}disabled{{end}}">
  149. {{.i18n.Tr "repo.cloudbrain.new"}}
  150. </button>
  151. <a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a>
  152. </div>
  153. </div>
  154. </form>
  155. {{else if eq .benchmarkMode "alogrithm"}}
  156. <form id="form_id" class="ui form alogrithm_form" action="{{.Link}}?benchmarkMode=alogrithm" method="post">
  157. {{.CsrfTokenHtml}}
  158. <input type="hidden" name="action" value="update">
  159. <input type="hidden" name="job_type" value="BENCHMARK">
  160. <div class="required min_title inline field">
  161. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_scenes"}}</label>
  162. <div class="ui blue small menu compact selectcloudbrain">
  163. <a class="active item alogrithm_benchmark"
  164. href="{{.Link}}?benchmarkMode=alogrithm">{{.i18n.Tr "repo.cloudbrain.benchmark.algorithm"}}</a>
  165. <a class="item model_benchmark"
  166. href="{{.Link}}?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a>
  167. <a class="item aisafety_benchmark"
  168. href="{{.RepoLink}}/modelsafety/create_gpu">模型安全评测</a>
  169. </div>
  170. </div>
  171. <div>
  172. <div class="min_title inline field" style="margin-top:-10px;">
  173. <label class="label-fix-width" style="font-weight: normal;"></label>
  174. {{template "custom/task_wait_count" .}}
  175. </div>
  176. <div class="required min_title inline field">
  177. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>
  178. <input style="width: 80%;" name="display_job_name" id="trainjob_job_name"
  179. placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}"
  180. tabindex="3" autofocus required maxlength="36">
  181. <span class="tooltips" style="display: block;margin-left: 11.5rem;">{{.i18n.Tr "repo.cloudbrain_jobname_err"}}</span>
  182. </div>
  183. <div class="min_title inline field">
  184. <label class="label-fix-width" style="font-weight: normal;"
  185. for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}}</label>
  186. <textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="254"
  187. placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}}
  188. onchange="this.value=this.value.substring(0, 255)"
  189. onkeydown="this.value=this.value.substring(0, 255)"
  190. onkeyup="this.value=this.value.substring(0, 255)">{{.description}}</textarea>
  191. </div>
  192. <!--<div class="required min_title inline field">
  193. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.gpu_type"}}</label>
  194. <select id="cloudbrain_gpu_type" class="ui search dropdown" placeholder="选择GPU类型"
  195. style='width:385px' name="gpu_type">
  196. {{range .benchmark_gpu_types}}
  197. <option value="{{.Queue}}">{{.Value}}</option>
  198. {{end}}
  199. </select>
  200. </div>-->
  201. <div class="required unite inline min_title fields" style="width: 90%;margin-left: 5.7rem;">&nbsp;
  202. <div class="required eight wide field">
  203. <label style="font-weight: normal;white-space: nowrap;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_type"}}</label>
  204. <select class="ui fluid selection search dropdown" id="benchmark_types_id"
  205. name="benchmark_types_id">
  206. {{range .benchmark_types}}
  207. {{if eq .Id $.benchmarkTypeID}}
  208. <option value="{{.Id}}" selected="true">{{.First}}</option>
  209. {{else}}
  210. <option value="{{.Id}}">{{.First}}</option>
  211. {{end}}
  212. {{end}}
  213. </select>
  214. </div>
  215. <div class="eight wide field" id="engine_name">
  216. <input type="hidden" id="benchmark_child_types_id_hidden" name="benchmark_child_types_id_hidden" value="{{.benchmark_child_types_id_hidden}}">
  217. <label style="font-weight: normal;white-space: nowrap;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_child_type"}}</label>
  218. <select class="ui fluid selection dropdown nowrapx" id="benchmark_child_types_id" style='width: 100%;' name="benchmark_child_types_id">
  219. </select>
  220. </div>
  221. </div>
  222. <div id="images-new-cb">
  223. </div>
  224. <!--<div class="required min_title inline field">
  225. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label>
  226. <select id="cloudbrain_resource_spec" class="ui search dropdown"
  227. placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px'
  228. name="resource_spec_id">
  229. {{range .benchmark_resource_specs}}
  230. <option name="resource_spec_id" value="{{.Id}}">
  231. {{$.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}}
  232. </option>
  233. {{end}}
  234. </select>
  235. </div>-->
  236. <div class="required min_title inline field">
  237. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label>
  238. <select id="__specs__" class="ui search dropdown width48"
  239. placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' ovalue="{{.spec_id}}"
  240. {{if .CloudBrainPaySwitch}}blance="{{.PointAccount.Balance}}"{{end}}
  241. name="spec_id">
  242. </select>
  243. <span><i class="question circle icon link"></i></span>
  244. <a href="{{AppSubUrl}}/resource_desc" target="_blank">{{.i18n.Tr "custom.resource_description"}}</a>
  245. {{if .CloudBrainPaySwitch}}
  246. <div class="cloudbrain_resource_spec_blance_tip width48" style="padding:0 5px;margin:6px 0;margin-left:155px;font-size:12px;">
  247. <span>{{$.i18n.Tr "points.balance_of_points"}}<span style="color:red;margin: 0 3px">{{.PointAccount.Balance}}</span>{{$.i18n.Tr "points.points"}}</span><span>{{$.i18n.Tr "points.expected_time"}}<span style="color:red;margin: 0 3px" class="can-use-time"></span>{{$.i18n.Tr "points.hours"}}</span>
  248. <span style="float:right;">
  249. <i class="question circle icon link" data-position="right center" data-variation="mini"></i>
  250. <a href="{{AppSubUrl}}/reward/point/rule" target="_blank">{{$.i18n.Tr "points.points_acquisition_instructions"}}</a>
  251. </span>
  252. </div>
  253. {{end}}
  254. </div>
  255. <div class="inline min_title field required">
  256. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_train"}}</label>
  257. <input disabled="disabled" style="width: 33.5%;" name="train_file" id="train_file"
  258. value="train.py" tabindex="3" autofocus required maxlength="254">
  259. <a id="train_href_id" href="https://openi.pcl.ac.cn/CV_benchmark/CV_reID_benchmark"
  260. target="_blank">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_train"}}</a>
  261. </div>
  262. <div class="inline min_title field required">
  263. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_test"}}</label>
  264. <input disabled="disabled" style="width: 33.5%;" name="test_file" id="test_file" value="test.py"
  265. tabindex="3" autofocus required maxlength="254">
  266. <a id="test_href_id" href="https://openi.pcl.ac.cn/CV_benchmark/CV_reID_benchmark"
  267. target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a>
  268. </div>
  269. <div class="inline unite min_title field">
  270. <label class="label-fix-width" style="font-weight: normal;"></label>
  271. <button class="ui create_train_job green button {{if eq .NotStopTaskCount 1}}disabled{{end}}">
  272. {{.i18n.Tr "repo.cloudbrain.new"}}
  273. </button>
  274. <a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a>
  275. </div>
  276. </div>
  277. </form>
  278. {{else if eq .benchmarkMode "aisafety"}}
  279. <form id="form_id" class="ui form alogrithm_form" action="{{.Link}}?benchmarkMode=alogrithm" method="post">
  280. {{.CsrfTokenHtml}}
  281. <input type="hidden" name="action" value="update">
  282. <input type="hidden" name="job_type" value="BENCHMARK">
  283. <div class="required min_title inline field">
  284. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_scenes"}}</label>
  285. <div class="ui blue small menu compact selectcloudbrain">
  286. <a class="item alogrithm_benchmark"
  287. href="{{.Link}}?benchmarkMode=alogrithm">{{.i18n.Tr "repo.cloudbrain.benchmark.algorithm"}}</a>
  288. <a class="item model_benchmark"
  289. href="{{.Link}}?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a>
  290. <a class="active item aisafety_benchmark"
  291. href="{{.RepoLink}}/modelsafety/create_gpu">模型安全评测</a>
  292. </div>
  293. </div>
  294. <div>
  295. <div class="min_title inline field" style="margin-top:-10px;">
  296. <label class="label-fix-width" style="font-weight: normal;"></label>
  297. {{template "custom/task_wait_count" .}}
  298. </div>
  299. <div class="required min_title inline field">
  300. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>
  301. <input style="width: 80%;" name="display_job_name" id="trainjob_job_name"
  302. placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}"
  303. tabindex="3" autofocus required maxlength="36">
  304. <span class="tooltips" style="display: block;margin-left: 11.5rem;">{{.i18n.Tr "repo.cloudbrain_jobname_err"}}</span>
  305. </div>
  306. <div class="min_title inline field">
  307. <label class="label-fix-width" style="font-weight: normal;"
  308. for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}}</label>
  309. <textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="254"
  310. placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}}
  311. onchange="this.value=this.value.substring(0, 255)"
  312. onkeydown="this.value=this.value.substring(0, 255)"
  313. onkeyup="this.value=this.value.substring(0, 255)">{{.description}}</textarea>
  314. </div>
  315. <div id="images-new-cb">
  316. </div>
  317. <div class="required min_title inline field">
  318. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label>
  319. <select id="__specs__" class="ui search dropdown width48"
  320. placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' ovalue="{{.spec_id}}"
  321. name="spec_id">
  322. </select>
  323. <span><i class="question circle icon link"></i></span>
  324. <a href="{{AppSubUrl}}/resource_desc" target="_blank">{{.i18n.Tr "custom.resource_description"}}</a>
  325. </div>
  326. <div class="inline min_title field required">
  327. <label class="label-fix-width" style="font-weight: normal;">推理程序</label>
  328. <input disabled="disabled" style="width: 33.5%;" name="test_file" id="test_file" value="test.py"
  329. tabindex="3" autofocus required maxlength="254">
  330. <a id="test_href_id" href="https://openi.pcl.ac.cn/CV_benchmark/CV_reID_benchmark"
  331. target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a>
  332. </div>
  333. <div class="inline unite min_title field">
  334. <label class="label-fix-width" style="font-weight: normal;"></label>
  335. <button class="ui create_train_job green button {{if eq .NotStopTaskCount 1}}disabled{{end}}">
  336. {{.i18n.Tr "repo.cloudbrain.new"}}
  337. </button>
  338. <a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a>
  339. </div>
  340. </div>
  341. </form>
  342. {{end}}
  343. </div>
  344. </div>
  345. </div>
  346. {{template "base/footer" .}}
  347. <script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script>
  348. <script>
  349. let form = document.getElementById('form_id');
  350. let createFlag = false
  351. form.onsubmit = function (e) {
  352. if(createFlag) return false
  353. createFlag = true
  354. }
  355. let repolink = {{.RepoLink }}
  356. let url_href = window.location.pathname.split('create')[0]
  357. $(".ui.button").attr('href', url_href)
  358. $('.menu .item')
  359. .tab();
  360. $('#benchmark_types_id').change(function () {
  361. setChildType();
  362. })
  363. $(document).ready(() => {
  364. $('.ui.search.dropdown.job_type').dropdown({
  365. onChange: function (value, text, $selectedItem) {
  366. if (value === "BRAINSCORE") {
  367. $('#brainscore_child_type').css('display', 'block')
  368. $('#benchmark_model_example').attr('href', 'https://openi.pcl.ac.cn/BDIP/similarity2brain_ann')
  369. } else {
  370. $('#brainscore_child_type').css('display', 'none')
  371. $('#benchmark_model_example').attr('href', 'https://openi.pcl.ac.cn/BDIP/snn4imagenet')
  372. }
  373. }
  374. })
  375. })
  376. function setChildType() {
  377. let type_id = $('#benchmark_types_id').val();
  378. if (type_id == 3) {
  379. $('#train_href_id').attr('href', 'https://openi.pcl.ac.cn/CV_benchmark/CV_MOT_benchmark');
  380. $('#test_href_id').attr('href', 'https://openi.pcl.ac.cn/CV_benchmark/CV_MOT_benchmark');
  381. } else {
  382. $('#train_href_id').attr('href', 'https://openi.pcl.ac.cn/CV_benchmark/CV_reID_benchmark');
  383. $('#test_href_id').attr('href', 'https://openi.pcl.ac.cn/CV_benchmark/CV_reID_benchmark');
  384. }
  385. let child_selected_id = $('#benchmark_child_types_id_hidden').val();
  386. $.get(`${repolink}/cloudbrain/benchmark/get_child_types?benchmark_type_id=${type_id}`, (data) => {
  387. const n_length = data['child_types'].length
  388. let html = ''
  389. for (let i = 0; i < n_length; i++) {
  390. if (child_selected_id == data['child_types'][i].id) {
  391. html += `<option value="${data['child_types'][i].id}" selected="true">${data['child_types'][i].value}</option>`;
  392. } else {
  393. html += `<option value="${data['child_types'][i].id}">${data['child_types'][i].value}</option>`;
  394. }
  395. }
  396. document.getElementById("benchmark_child_types_id").innerHTML = html;
  397. })
  398. }
  399. document.onreadystatechange = function () {
  400. if (document.readyState === "complete") {
  401. if ($('input[name=benchmarkMode]').val() === 'alogrithm' || $('input[name=benchmarkMode]').val() === '') {
  402. setChildType();
  403. }
  404. }
  405. }
  406. var isValidate = false;
  407. function validate() {
  408. $('.ui.form')
  409. .form({
  410. on: 'blur',
  411. fields: {
  412. image: {
  413. identifier: 'image',
  414. rules: [
  415. {
  416. type: 'empty',
  417. promt: ''
  418. }
  419. ]
  420. },
  421. display_job_name: {
  422. identifier: 'display_job_name',
  423. rules: [
  424. {
  425. type: 'regExp[/^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/]',
  426. promt: ''
  427. }
  428. ]
  429. },
  430. spec_id: {
  431. identifier: 'spec_id',
  432. rules: [{ type: 'empty' }]
  433. }
  434. },
  435. onSuccess: function () {
  436. // $('.ui.page.dimmer').dimmer('show')
  437. document.getElementById("mask").style.display = "block"
  438. isValidate = true;
  439. },
  440. onFailure: function (e) {
  441. isValidate = false;
  442. return false;
  443. }
  444. })
  445. }
  446. validate()
  447. $('.ui.create_train_job.green.button').click(function (e) {
  448. validate()
  449. })
  450. ;(function() {
  451. var SPECS = {{ .benchmark_specs }};
  452. var showPoint = {{ .CloudBrainPaySwitch }};
  453. window.renderSpecsSelect($('#__specs__'), SPECS, showPoint, {
  454. gpu_memory: {{$.i18n.Tr "cloudbrain.gpu_memory"}},
  455. free: {{$.i18n.Tr "cloudbrain.free"}},
  456. point_hr: {{$.i18n.Tr "cloudbrain.point_hr"}},
  457. memory: {{$.i18n.Tr "cloudbrain.memory"}},
  458. shared_memory: {{$.i18n.Tr "cloudbrain.shared_memory"}},
  459. });
  460. })();
  461. </script>