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 16 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. {{template "base/head" .}}
  2. <style>
  3. .train-job-title {
  4. font-family: SourceHanSansSC-medium !important;
  5. color: rgba(16, 16, 16, 100) !important;
  6. font-size: 16px !important;
  7. padding-left: 3rem !important;
  8. }
  9. .min_title{
  10. font-size: 14px !important;
  11. margin-bottom: 2rem !important;
  12. }
  13. .width {
  14. width: 100% !important;
  15. }
  16. .width48 {
  17. width: 48.5% !important;
  18. }
  19. .width80 {
  20. width: 80.7% !important;
  21. margin-left: 10px;
  22. }
  23. .width806 {
  24. width: 80.6% !important;
  25. margin-left: -2px;
  26. }
  27. .width85 {
  28. width: 85% !important;
  29. margin-left: 10.5rem !important;
  30. align-items: center;
  31. }
  32. .width81 {
  33. margin-left: 1.5rem !important;
  34. width: 81% !important;
  35. }
  36. .add {
  37. font-size: 18px;
  38. padding: 0.5rem;
  39. border: 1px solid rgba(187, 187, 187, 100);
  40. border-radius: 0px 5px 5px 0px;
  41. line-height: 21px;
  42. text-align: center;
  43. color: #C2C7CC;
  44. }
  45. .min {
  46. font-size: 18px;
  47. padding: 0.5rem;
  48. border: 1px solid rgba(187, 187, 187, 100);
  49. border-radius: 5px 0px 0px 5px;
  50. line-height: 21px;
  51. text-align: center;
  52. color: #C2C7CC;
  53. }
  54. .label-fix-width{
  55. width: 140px !important;
  56. text-align: right;
  57. font-family: SourceHanSansSC-medium !important;
  58. color: rgba(16, 16, 16, 100) !important;
  59. font-size: 14px !important;
  60. }
  61. </style>
  62. {{template "custom/global_mask" .}}
  63. <div class="repository">
  64. {{template "repo/header" .}}
  65. <div class="ui container">
  66. <div class="cloudbrain-type" style="display: none;" data-cloudbrain-type="{{.datasetType}}" data-repo-link="{{.RepoLink}}" data-flag-model="true" data-dataset-uuid="{{.attachment}}" data-dataset-name="{{.dataset_name}}" data-queue="{{.QueuesDetail}}" data-queue-start="{{.i18n.Tr "repo.wait_count_start"}}" data-queue-end="{{.i18n.Tr "repo.wait_count_end"}}"></div>
  67. {{template "base/alert" .}}
  68. {{template "custom/alert_cb" .}}
  69. <h4 class="ui top attached header">
  70. {{.i18n.Tr "repo.modelarts.train_job.new"}}
  71. </h4>
  72. <div class="ui attached segment">
  73. <!-- equal width -->
  74. <form id="form_id" class="ui form" action="{{.Link}}" method="post">
  75. {{.CsrfTokenHtml}}
  76. <input type="hidden" name="action" value="update">
  77. <input type="hidden" id="ai_image_name" value="{{.image}}">
  78. <h4 class="train-job-title ui header ">{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}:</h4>
  79. <div class="required unite min_title inline field">
  80. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_cluster"}}</label>
  81. <div class="ui blue mini menu compact selectcloudbrain">
  82. <a class="active item" href="{{.RepoLink}}/cloudbrain/train-job/create">
  83. <svg class="svg" sxmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.008 8.008 0 0 0 5.648 6.667zM10.03 13c.151 2.439.848 4.73 1.97 6.752A15.905 15.905 0 0 0 13.97 13h-3.94zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.008 8.008 0 0 0 19.938 13zM4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333 8.008 8.008 0 0 0 4.062 11zm5.969 0h3.938A15.905 15.905 0 0 0 12 4.248 15.905 15.905 0 0 0 10.03 11zm4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.008 8.008 0 0 0-5.648-6.667z"></path></svg>
  84. {{.i18n.Tr "cloudbrain.resource_cluster_openi"}}
  85. </a>
  86. <a class="item" href="{{.RepoLink}}/grampus/train-job/npu/create">
  87. <svg class="svg" sxmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.008 8.008 0 0 0 5.648 6.667zM10.03 13c.151 2.439.848 4.73 1.97 6.752A15.905 15.905 0 0 0 13.97 13h-3.94zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.008 8.008 0 0 0 19.938 13zM4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333 8.008 8.008 0 0 0 4.062 11zm5.969 0h3.938A15.905 15.905 0 0 0 12 4.248 15.905 15.905 0 0 0 10.03 11zm4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.008 8.008 0 0 0-5.648-6.667z"></path></svg>
  88. {{.i18n.Tr "cloudbrain.resource_cluster_c2net"}}(Beta)
  89. </a>
  90. </div>
  91. </div>
  92. <div class="required min_title inline field">
  93. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.compute_resource"}}</label>
  94. <div class="ui blue mini menu compact selectcloudbrain">
  95. <a class="active item" href="{{.RepoLink}}/cloudbrain/train-job/create">
  96. <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16"
  97. height="16">
  98. <path fill="none" d="M0 0h24v24H0z" />
  99. <path
  100. 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" />
  101. </svg>
  102. CPU/GPU
  103. </a>
  104. <a class="item" href="{{.RepoLink}}/modelarts/train-job/create">
  105. <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16"
  106. height="16">
  107. <path fill="none" d="M0 0h24v24H0z" />
  108. <path
  109. 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" />
  110. </svg>
  111. Ascend NPU</a>
  112. </div>
  113. </div>
  114. <div class="min_title inline field" style="margin-top:-10px;">
  115. <label class="label-fix-width" style="font-weight: normal;"></label>
  116. {{template "custom/task_wait_count" .}}
  117. <div style="display: flex;align-items: center;margin-left: 156px;margin-top: 0.5rem;">
  118. <i class="ri-error-warning-line" style="color: #f2711c;margin-right: 0.5rem;"></i>
  119. <span style="color: #888;font-size: 12px;">{{.i18n.Tr "cloudbrain.new_train_gpu_tooltips" "/code" "/dataset" "ckpt_url" "/model" | Safe}}</span>
  120. </div>
  121. </div>
  122. <div class="required min_title inline field" style="margin-bottom: 0rem !important;">
  123. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>
  124. <input style="width: 60%;" name="display_job_name" id="display_job_name"
  125. placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}"
  126. tabindex="3" onkeyup="this.value=this.value.replace(/[, ]/g,'')" autofocus required
  127. maxlength="36">
  128. </div>
  129. <span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 2rem;">{{.i18n.Tr "repo.cloudbrain_jobname_err"}}</span>
  130. <div class="inline min_title field">
  131. <label class="label-fix-width" style="font-weight: normal;"
  132. for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}}</label>
  133. {{if .description}}
  134. <textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="255" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}}>{{.description}}</textarea>
  135. {{else}}
  136. <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>
  137. {{end}}
  138. </div>
  139. <div class="ui divider"></div>
  140. <h4 class="train-job-title ui header ">{{.i18n.Tr "repo.modelarts.train_job.parameter_setting"}}:</h4>
  141. <div class="required min_title inline field">
  142. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.code_version"}}</label>
  143. <select class="ui dropdown width80 left2" id="code_version" name="branch_name">
  144. {{if .branch_name}}
  145. <option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option>
  146. {{range $k, $v :=.Branches}}
  147. {{ if ne $v $.branch_name }}
  148. <option name="branch_name" value="{{$v}}">{{$v}}</option>
  149. {{end}}
  150. {{end}}
  151. {{else}}
  152. <option name="branch_name" value="{{.branchName}}">{{.branchName}}</option>
  153. {{range $k, $v :=.Branches}}
  154. {{ if ne $v $.branchName }}
  155. <option name="branch_name" value="{{$v}}">{{$v}}</option>
  156. {{end}}
  157. {{end}}
  158. {{end}}
  159. </select>
  160. </div>
  161. {{template "custom/select_model" .}}
  162. <div class="inline required field" style="display: none;">
  163. <label>{{.i18n.Tr "cloudbrain.task_type"}}</label>
  164. <select id="cloudbrain_job_type" class="ui search dropdown" placeholder="选择任务类型" style='width:385px'
  165. name="job_type">
  166. <option name="job_type" value="TRAIN">TRAIN</option>
  167. </select>
  168. </div>
  169. <div id="images-new-cb">
  170. </div>
  171. <div class="inline field min_title required">
  172. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.start_file"}}</label>
  173. {{if .boot_file}}
  174. <input style="width: 48.5%;" name="boot_file" id="trainjob_boot_file" value="{{.boot_file}}"
  175. tabindex="3" autofocus required maxlength="255">
  176. {{else}}
  177. <input style="width: 48.5%;" name="boot_file" id="trainjob_boot_file" value="" tabindex="3"
  178. autofocus required maxlength="255">
  179. {{end}}
  180. <span>
  181. <i class="question circle icon link"
  182. data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}}
  183. data-position="right center" data-variation="mini"></i>
  184. </span>
  185. <a href="https://git.openi.org.cn/OpenIOSSG/MNIST_PytorchExample_GPU" target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a>
  186. </div>
  187. <div id="select-multi-dataset">
  188. </div>
  189. <span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 1rem;"></span>
  190. <div class="inline min_title field">
  191. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label>
  192. <span id="add_run_para"
  193. style="margin-left: 0.5rem;cursor:pointer;color: rgba(3, 102, 214, 100);font-size: 14px;line-height: 26px;font-family: SourceHanSansSC-medium;"><i
  194. class="plus square outline icon"></i>{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}}</span>
  195. <input id="store_run_para" type="hidden" name="run_para_list">
  196. <div class="dynamic field" style="margin-top: 1rem;" data-params="{{.run_para_list}}" data-params-value="{{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}" data-params-name="{{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}">
  197. </div>
  198. </div>
  199. <div class="required min_title inline field">
  200. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label>
  201. <select id="__specs__" class="ui dropdown width48" placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" ovalue="{{.spec_id}}"
  202. {{if .CloudBrainPaySwitch}}blance="{{.PointAccount.Balance}}"{{end}}
  203. name="spec_id">
  204. </select>
  205. <span><i class="question circle icon link"></i></span>
  206. <a href="{{AppSubUrl}}/resource_desc" target="_blank">{{.i18n.Tr "custom.resource_description"}}</a>
  207. {{if .CloudBrainPaySwitch}}
  208. <div class="cloudbrain_resource_spec_blance_tip width48" style="padding:0 5px;margin:6px 0;margin-left:155px;font-size:12px;">
  209. <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>
  210. <span style="float:right;">
  211. <i class="question circle icon link" data-position="right center" data-variation="mini"></i>
  212. <a href="{{AppSubUrl}}/reward/point/rule" target="_blank">{{$.i18n.Tr "points.points_acquisition_instructions"}}</a>
  213. </span>
  214. </div>
  215. {{end}}
  216. </div>
  217. <div class="inline field" style="padding: 1rem 0;">
  218. <label class="label-fix-width"></label>
  219. <button class="ui create_train_job green button">
  220. {{.i18n.Tr "repo.cloudbrain.new"}}
  221. </button>
  222. <a class="ui button __btn-cancel-back__"
  223. href="{{.RepoLink}}/modelarts/train-job">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a>
  224. </div>
  225. <!-- 模态框 -->
  226. </form>
  227. </div>
  228. </div>
  229. </div>
  230. {{template "base/footer" .}}
  231. <script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script>
  232. <script src="{{StaticUrlPrefix}}/js/cloudbrainNew.js?v={{MD5 AppVer}}" type="text/javascript"></script>
  233. <script>
  234. ;(function() {
  235. var SPECS = {{ .train_specs }};
  236. var showPoint = {{ .CloudBrainPaySwitch }};
  237. window.renderSpecsSelect($('#__specs__'), SPECS, showPoint, {
  238. gpu_memory: {{$.i18n.Tr "cloudbrain.gpu_memory"}},
  239. free: {{$.i18n.Tr "cloudbrain.free"}},
  240. point_hr: {{$.i18n.Tr "cloudbrain.point_hr"}},
  241. memory: {{$.i18n.Tr "cloudbrain.memory"}},
  242. shared_memory: {{$.i18n.Tr "cloudbrain.shared_memory"}},
  243. });
  244. var backUrl = new URLSearchParams(window.location.search).get("backurl");
  245. if (backUrl) {
  246. $('.__btn-cancel-back__').attr('href', backUrl);
  247. }
  248. })();
  249. </script>