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

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