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.

show.tmpl 51 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011
  1. {{template "base/head" .}}
  2. <link rel="stylesheet" href="/self/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
  3. <style>
  4. .according-panel-heading {
  5. box-sizing: border-box;
  6. padding: 8px 16px;
  7. color: #252b3a;
  8. background-color: #f2f5fc;
  9. line-height: 1.5;
  10. cursor: pointer;
  11. -moz-user-select: none;
  12. -webkit-user-select: none;
  13. -ms-user-select: none;
  14. -khtml-user-select: none;
  15. user-select: none;
  16. }
  17. .accordion-panel-title {
  18. margin-top: 0;
  19. margin-bottom: 0;
  20. color: #252b3a;
  21. }
  22. .accordion-panel-title-content {
  23. vertical-align: middle;
  24. display: inline-block;
  25. width: calc(100% - 32px);
  26. cursor: default;
  27. }
  28. .acc-margin-bottom {
  29. margin-bottom: 5px;
  30. }
  31. .title_text {
  32. font-size: 12px;
  33. }
  34. .ac-display-inblock {
  35. display: inline-block;
  36. }
  37. .cti-mgRight-sm {
  38. margin-right: 8px;
  39. }
  40. .ac-text-normal {
  41. font-size: 14px;
  42. color: #575d6c;
  43. }
  44. .uc-accordionTitle-black {
  45. color: #333;
  46. }
  47. .accordion-border {
  48. border: 1px solid #cce2ff;
  49. }
  50. .padding0 {
  51. padding: 0 !important;
  52. }
  53. .content-pad {
  54. padding: 15px 35px;
  55. }
  56. .content-margin {
  57. margin: 10px 5px;
  58. }
  59. .tab_2_content {
  60. min-height: 360px;
  61. margin-left: 10px;
  62. }
  63. .ac-grid {
  64. display: block;
  65. *zoom: 1;
  66. }
  67. .ac-grid-col {
  68. float: left;
  69. width: 100%;
  70. }
  71. .ac-grid-col2 .ac-grid-col {
  72. width: 50%;
  73. }
  74. .ti-form {
  75. text-align: left;
  76. max-width: 100%;
  77. vertical-align: middle;
  78. }
  79. .ti-form>tbody {
  80. font-size: 12px;
  81. }
  82. .ti-form>tbody,
  83. .ti-form>tbody>tr {
  84. vertical-align: inherit;
  85. }
  86. .ti-text-form-label {
  87. padding-bottom: 20px;
  88. padding-right: 20px;
  89. color: #8a8e99;
  90. font-size: 12px;
  91. white-space: nowrap !important;
  92. width: 80px;
  93. line-height: 30px;
  94. }
  95. .ti-text-form-content {
  96. line-height: 30px;
  97. padding-bottom: 20px;
  98. }
  99. .ti-form>tbody>tr>td {
  100. vertical-align: top;
  101. white-space: normal;
  102. }
  103. td,
  104. th {
  105. padding: 0;
  106. }
  107. .ac-grid-col .text-span {
  108. width: 450px;
  109. overflow: hidden;
  110. text-overflow: ellipsis;
  111. white-space: nowrap;
  112. }
  113. .redo-color {
  114. color: #3291F8;
  115. }
  116. .ti-action-menu-item:not(:last-child) {
  117. margin-right: 10px;
  118. padding-right: 11px;
  119. text-decoration: none !important;
  120. color: #526ecc;
  121. cursor: pointer;
  122. display: inline-block;
  123. -moz-user-select: none;
  124. -webkit-user-select: none;
  125. -ms-user-select: none;
  126. -khtml-user-select: none;
  127. user-select: none;
  128. position: relative;
  129. }
  130. .ti-action-menu-item:not(:last-child):after {
  131. content: "";
  132. display: inline-block;
  133. position: absolute;
  134. height: 12px;
  135. right: 0;
  136. top: 50%;
  137. -webkit-transform: translateY(-6px);
  138. -ms-transform: translateY(-6px);
  139. -o-transform: translateY(-6px);
  140. transform: translateY(-6px);
  141. border-right: 1px solid #dfe1e6;
  142. }
  143. .text-width80 {
  144. width: 100px;
  145. line-height: 30px;
  146. }
  147. .border-according {
  148. border: 1px solid #dfe1e6;
  149. }
  150. .disabled {
  151. cursor: default;
  152. pointer-events: none;
  153. color: rgba(0, 0, 0, .6) !important;
  154. opacity: .45 !important;
  155. }
  156. .pad20 {
  157. border: 0px !important;
  158. }
  159. .model_file_bread {
  160. margin-bottom: -0.5rem !important;
  161. padding-left: 1rem;
  162. padding-top: 0.5rem;
  163. }
  164. .menuContent{
  165. position: absolute;
  166. background: #ffffff;
  167. left: 0;
  168. right: 26px;
  169. top: 36px;
  170. z-index:999;
  171. border: 1px solid #96c8da;
  172. border-top: 0;
  173. border-bottom-right-radius: 4px;
  174. border-bottom-left-radius: 4px;
  175. box-shadow: 0 2px 3px 0 rgb(34 36 38 / 15%);
  176. }
  177. </style>
  178. {{template "custom/global_mask" .}}
  179. <div class="repository">
  180. {{template "repo/header" .}}
  181. <div class="ui container">
  182. <h4 class="ui header" id="vertical-segment">
  183. <div class="ui breadcrumb">
  184. <a class="section" href="{{.RepoLink}}/debugjob?debugListType=all">
  185. {{.i18n.Tr "repo.cloudbrain"}}
  186. </a>
  187. <div class="divider"> / </div>
  188. <a class="section" href="{{$.RepoLink}}/modelarts/train-job">
  189. {{$.i18n.Tr "repo.modelarts.train_job"}}
  190. </a>
  191. <div class="divider"> / </div>
  192. <div class="active section">{{.displayJobName}}</div>
  193. </div>
  194. </h4>
  195. {{range $k ,$v := .version_list_task}}
  196. <div class="ui accordion border-according" id="accordion{{.VersionName}}"
  197. data-repopath="{{$.RepoRelPath}}/grampus/train-job" data-jobid="{{.JobID}}"
  198. data-version="{{.VersionName}}">
  199. <div class="{{if eq $k 0}}active{{end}} title padding0">
  200. <div class="according-panel-heading">
  201. <div class="accordion-panel-title">
  202. <i class="dropdown icon"></i>
  203. <span class="accordion-panel-title-content">
  204. <span>
  205. <div style="float: right;">
  206. {{$.CsrfTokenHtml}}
  207. </div>
  208. <div class="ac-display-inblock title_text acc-margin-bottom">
  209. <span class="cti-mgRight-sm">{{TimeSinceUnix1 .CreatedUnix}}</span>
  210. <span class="cti-mgRight-sm">
  211. {{$.i18n.Tr "repo.modelarts.current_version"}}:{{.VersionName}}</span>
  212. <span class="cti-mgRight-sm">
  213. {{$.i18n.Tr "repo.modelarts.parent_version"}}:{{.PreVersionName}}</span>
  214. <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}:
  215. <span id="{{.VersionName}}-status-span"><i id="icon"
  216. style="vertical-align: middle;" class="{{.Status}}"></i><span id="text"
  217. style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span>
  218. </span>
  219. <span
  220. class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}:</span>
  221. <span class="cti-mgRight-sm uc-accordionTitle-black"
  222. id="{{.VersionName}}-duration-span">{{.TrainJobDuration}}</span>
  223. <span class="refresh-status" data-tooltip="刷新" style="cursor: pointer;" data-inverted="" data-version="{{.VersionName}}">
  224. <i class="redo icon redo-color"></i>
  225. </span>
  226. </div>
  227. <div style="float: right;">
  228. {{if and ($.canDownload) (ne .Status "WAITING") ($.Permission.CanWrite $.UnitTypeModelManage) }}
  229. <a class="ti-action-menu-item" id="{{.VersionName}}-create-model"
  230. onclick="showcreate({DisplayJobName:{{.DisplayJobName}},JobName:{{.JobName}},JobID:{{.JobID}},VersionName:{{.VersionName}},EngineName:{{.EngineName}},ComputeResource:{{.ComputeResource}},Type:{{.Type}}})">{{$.i18n.Tr "repo.modelarts.create_model"}}</a>
  231. {{else}}
  232. <a class="ti-action-menu-item disabled" id="{{.VersionName}}-create-model">{{$.i18n.Tr "repo.modelarts.create_model"}}</a>
  233. {{end}}
  234. </div>
  235. </span>
  236. </span>
  237. </div>
  238. </div>
  239. </div>
  240. <div class="{{if eq $k 0}}active{{end}} content">
  241. <div class="content-pad">
  242. <div class="ui pointing secondary menu" style="border-bottom: 1px solid rgba(34,36,38,.15);">
  243. <a class="active item" data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a>
  244. <a class="item log_bottom" data-tab="second{{$k}}" data-version="{{.VersionName}}">{{$.i18n.Tr "repo.modelarts.log"}}</a>
  245. {{ if eq $.Spec.ComputeResource "NPU"}}
  246. <a class="item metric_chart" data-tab="four{{$k}}" data-version="{{.VersionName}}" data-path="{{$.RepoRelPath}}/grampus/train-job/{{.JobID}}/metrics">{{$.i18n.Tr "cloudbrain.resource_use"}}</a>
  247. {{end}}
  248. <a class="item load-model-file" data-tab="third{{$k}}" data-download-flag="{{$.canDownload}}" data-path="{{$.RepoLink}}/modelarts/train-job/{{.JobID}}/model_list" data-version="{{.VersionName}}" data-parents="" data-filename="" data-init="init" >{{$.i18n.Tr "repo.model_download"}}</a>
  249. </div>
  250. <div class="ui tab active" data-tab="first{{$k}}">
  251. <div style="padding-top: 10px;">
  252. <div class="tab_2_content">
  253. <div class="ac-grid ac-grid-col2">
  254. <div class="ac-grid-col">
  255. <table class="ti-form">
  256. <tbody class="ti-text-form">
  257. <tr class="ti-no-ng-animate">
  258. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  259. {{$.i18n.Tr "repo.cloudbrain_task"}}
  260. </td>
  261. <td class="ti-text-form-content">
  262. <div class="text-span text-span-w">
  263. {{.DisplayJobName}}
  264. </div>
  265. </td>
  266. </tr>
  267. <tr class="ti-no-ng-animate">
  268. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  269. {{$.i18n.Tr "repo.modelarts.status"}}
  270. </td>
  271. <td class="ti-text-form-content">
  272. <div class="text-span text-span-w" id="{{.VersionName}}-status">
  273. {{.Status}}
  274. </div>
  275. </td>
  276. </tr>
  277. <tr class="ti-no-ng-animate">
  278. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  279. {{$.i18n.Tr "repo.modelarts.run_version"}}
  280. </td>
  281. <td class="ti-text-form-content">
  282. <div class="text-span text-span-w">
  283. {{if .VersionName}}{{.VersionName}}{{else}}--{{end}}
  284. </div>
  285. </td>
  286. </tr>
  287. <tr class="ti-no-ng-animate">
  288. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  289. {{$.i18n.Tr "repo.modelarts.train_job.start_time"}}
  290. </td>
  291. <td class="ti-text-form-content">
  292. <div class="text-span text-span-w">
  293. <span style="font-size: 12px;" id="{{.VersionName}}-startTime">
  294. {{if not (eq .StartTime 0)}}
  295. {{TimeSinceUnix1 .StartTime}}
  296. {{else}}
  297. --
  298. {{end}}</span>
  299. </div>
  300. </td>
  301. </tr>
  302. <tr class="ti-no-ng-animate">
  303. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  304. {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}
  305. </td>
  306. <td class="ti-text-form-content">
  307. <div class="text-span text-span-w"
  308. id="{{.VersionName}}-duration">
  309. {{.TrainJobDuration}}
  310. </div>
  311. </td>
  312. </tr>
  313. <tr class="ti-no-ng-animate">
  314. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  315. {{$.i18n.Tr "repo.modelarts.model_name"}}
  316. </td>
  317. <td class="ti-text-form-content">
  318. <div class="text-span text-span-w">{{if .ModelName}}{{.ModelName}}{{else}}--{{end}}</div>
  319. </td>
  320. </tr>
  321. <tr class="ti-no-ng-animate">
  322. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  323. {{$.i18n.Tr "repo.modelconvert.modelversion"}}
  324. </td>
  325. <td class="ti-text-form-content">
  326. <div class="text-span text-span-w">{{if .ModelVersion}}{{.ModelVersion}}{{else}}--{{end}}</div>
  327. </td>
  328. </tr>
  329. <tr class="ti-no-ng-animate">
  330. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  331. {{$.i18n.Tr "repo.modelarts.infer_job_model_file"}}
  332. </td>
  333. <td class="ti-text-form-content">
  334. <div class="text-span text-span-w">{{if .CkptName}}{{.CkptName}}{{else}}--{{end}}</div>
  335. </td>
  336. </tr>
  337. </tbody>
  338. </table>
  339. </div>
  340. <div class="ac-grid-col">
  341. <table class="ti-form">
  342. <tbody class="ti-text-form">
  343. {{ if eq $.Spec.ComputeResource "GPU"}}
  344. <tr class="ti-no-ng-animate">
  345. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  346. {{$.i18n.Tr "cloudbrain.mirror"}}
  347. </td>
  348. <td class="ti-text-form-content">
  349. <div class="text-span text-span-w">
  350. <span class="ui poping up clipboard" data-position="top center" id="clipboard-btn-image" style="cursor:pointer"
  351. data-clipboard-text="{{.EngineName}}"
  352. data-success="{{$.i18n.Tr "repo.copy_link_success"}}"
  353. data-error="{{$.i18n.Tr "repo.copy_link_error"}}"
  354. data-content="{{$.i18n.Tr "repo.copy_link"}}"
  355. data-variation="inverted tiny"
  356. >
  357. <span title="{{.EngineName}}">{{.EngineName}}</span>
  358. </span>
  359. </div>
  360. </td>
  361. </tr>
  362. {{else}}
  363. <tr class="ti-no-ng-animate">
  364. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  365. {{$.i18n.Tr "repo.modelarts.train_job.AI_driver"}}
  366. </td>
  367. <td class="ti-text-form-content">
  368. <div class="text-span text-span-w">
  369. {{.EngineName}}
  370. </div>
  371. </td>
  372. </tr>
  373. {{end}}
  374. <tr class="ti-no-ng-animate">
  375. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  376. {{$.i18n.Tr "repo.modelarts.code_version"}}
  377. </td>
  378. <td class="ti-text-form-content">
  379. <div class="text-span text-span-w">
  380. {{.BranchName}}
  381. <span style="margin-left:1rem" class="ui label">{{SubStr .CommitID 0 10}}</span>
  382. </div>
  383. </td>
  384. </tr>
  385. <tr class="ti-no-ng-animate">
  386. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  387. {{$.i18n.Tr "repo.modelarts.train_job.start_file"}}
  388. </td>
  389. <td class="ti-text-form-content">
  390. <div class="text-span text-span-w">
  391. {{.BootFile}}
  392. </div>
  393. </td>
  394. </tr>
  395. <tr class="ti-no-ng-animate">
  396. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  397. {{$.i18n.Tr "repo.modelarts.train_job.run_parameter"}}
  398. </td>
  399. <td class="ti-text-form-content">
  400. <div class="text-span text-span-w" title="{{.Parameters}}">
  401. {{if .Parameters}}{{.Parameters}}{{else}}--{{end}}
  402. </div>
  403. </td>
  404. </tr>
  405. <tr class="ti-no-ng-animate">
  406. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  407. {{$.i18n.Tr "repo.grampus.train_job.ai_center"}}
  408. </td>
  409. <td class="ti-text-form-content">
  410. <div class="text-span text-span-w" id="{{.VersionName}}-ai_center">
  411. {{if $.ai_center}}{{$.ai_center}}{{else}}--{{end}}
  412. </div>
  413. </td>
  414. </tr>
  415. <tr class="ti-no-ng-animate">
  416. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  417. {{$.i18n.Tr "repo.modelarts.train_job.standard"}}
  418. </td>
  419. <td class="ti-text-form-content spec">
  420. <div class="text-span text-span-w"></div>
  421. </td>
  422. </tr>
  423. <tr class="ti-no-ng-animate">
  424. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  425. {{$.i18n.Tr "repo.modelarts.train_job.compute_node"}}
  426. </td>
  427. <td class="ti-text-form-content">
  428. <div class="text-span text-span-w">
  429. {{.WorkServerNumber}}
  430. </div>
  431. </td>
  432. </tr>
  433. <tr class="ti-no-ng-animate">
  434. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  435. {{$.i18n.Tr "repo.modelarts.train_job.description"}}
  436. </td>
  437. <td class="ti-text-form-content">
  438. <div class="text-span text-span-w"
  439. title="{{.Description}}">
  440. {{if .Description}}{{.Description}}{{else}}--{{end}}
  441. </div>
  442. </td>
  443. </tr>
  444. </tbody>
  445. </table>
  446. </div>
  447. </div>
  448. </div>
  449. <div style="clear:both">
  450. <table style="border:none" class="ui fixed small stackable table">
  451. <thead>
  452. <tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">{{$.i18n.Tr "dataset.file"}}</th>
  453. </tr></thead>
  454. <tbody>
  455. {{range $m ,$n := $.datasetDownload}}
  456. <tr>
  457. <td style="word-wrap: break-word;word-break: break-all;">
  458. {{if eq .IsDelete true}}
  459. {{.DatasetName}}({{$.i18n.Tr "dataset.file_deleted"}})
  460. {{else}}
  461. <a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a>
  462. {{end}}
  463. </td>
  464. </tr>
  465. {{end}}
  466. </tbody>
  467. </table>
  468. </div>
  469. </div>
  470. </div>
  471. <div class="ui tab" data-tab="second{{$k}}">
  472. <div class="file-info">
  473. <a id="{{.VersionName}}-log-down"
  474. class='{{if $.canDownload}}ti-download-file{{else}}disabled{{end}} file-info'
  475. href="/api/v1/repos/{{$.RepoRelPath}}/grampus/train-job/{{.JobID}}/download_log">
  476. <i class="ri-download-cloud-2-line"></i>
  477. <span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.download_log"}}</span>
  478. </a>
  479. <div class="file-info full-log-dialog" data-version="{{.VersionName}}" data-log="{{$.i18n.Tr "repo.modelarts.log_file"}}" data-log-type="c2Net"
  480. data-exit="{{$.i18n.Tr "repo.modelarts.exit_full_screen"}}" style="margin-left: 1rem;color:#0366d6;cursor: pointer;"
  481. data-log-down="{{$.i18n.Tr "repo.modelarts.download_log"}}" data-href="/api/v1/repos/{{$.RepoRelPath}}/grampus/train-job/{{.JobID}}/download_log"
  482. data-scroll-top="{{$.i18n.Tr "repo.log_scroll_start"}}" data-scroll-bottom="{{$.i18n.Tr "repo.log_scroll_end"}}">
  483. <i class="ri-aspect-ratio-line"></i>
  484. <span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.fullscreen_log_file"}}</span>
  485. </div>
  486. </div>
  487. <div style="position: relative;border: 1px solid rgba(0,0,0,.2);padding: 0 10px;margin-top: 10px;">
  488. <span>
  489. <a title="{{$.i18n.Tr "repo.log_scroll_start"}}" style="position: absolute; right: -32px;cursor: pointer;"
  490. class="log_top" data-version="{{.VersionName}}"><i class="icon-to-top"></i></a>
  491. </span>
  492. <span class="log-info-{{.VersionName}}">
  493. <a title="{{$.i18n.Tr "repo.log_scroll_end"}}" style="position: absolute; bottom: 10px;right: -32px;cursor: pointer;"
  494. class="log_bottom" data-version="{{.VersionName}}"><i
  495. class="icon-to-bottom"></i></a>
  496. </span>
  497. <div class="ui message message{{.VersionName}}" style="display: none;">
  498. <div id="header"></div>
  499. </div>
  500. <div class="ui attached log" id="log{{.VersionName}}"
  501. style="height: 300px !important; overflow: auto;">
  502. <div class="ui inverted active dimmer">
  503. <div class="ui loader"></div>
  504. </div>
  505. <input type="hidden" name="end_line" value>
  506. <input type="hidden" name="end_line-max" value>
  507. <input type="hidden" name="start_line-max" value>
  508. <input type="hidden" name="start_line-max-copy" value>
  509. <input type="hidden" name="start_line" value>
  510. <input type="hidden" name="init_log" value>
  511. <pre id="log_file{{.VersionName}}"></pre>
  512. </div>
  513. </div>
  514. </div>
  515. <div class="ui tab" data-tab="four{{$k}}" style="position: relative;">
  516. <i class="ri-refresh-line metric_chart"
  517. style="position: absolute;right: 25%;color:#3291f8;z-index:99;cursor: pointer;"
  518. data-version="{{.VersionName}}"></i>
  519. <div id="metric-{{.VersionName}}" style="height: 260px;width: 870px;">
  520. </div>
  521. </div>
  522. <div class="ui tab" data-tab="third{{$k}}">
  523. <input type="hidden" name="model{{.VersionName}}" value="-1">
  524. <input type="hidden" name="modelback{{.VersionName}}" value="-1">
  525. <div class='ui breadcrumb model_file_bread' id='file_breadcrumb{{.VersionName}}'>
  526. <div class="active section">{{.VersionName}}</div>
  527. <div class="divider"> / </div>
  528. </div>
  529. <div id="dir_list{{.VersionName}}">
  530. </div>
  531. {{if eq .ComputeResource "CPU/GPU"}}
  532. <div style="display:flex;align-items: center;justify-content: end;color: #f2711c;">
  533. <i class="ri-error-warning-line" style="margin-right:0.5rem;"></i>
  534. <span>{{$.i18n.Tr "repo.file_limit_100"}}</span>
  535. </div>
  536. {{end}}
  537. </div>
  538. </div>
  539. </div>
  540. </div>
  541. {{template "custom/max_log" .}}
  542. {{end}} {{template "base/paginate" .}}
  543. </div>
  544. <!-- 确认模态框 -->
  545. <div id="deletemodel">
  546. <div class="ui basic modal">
  547. <div class="ui icon header">
  548. <i class="trash icon"></i> {{.i18n.Tr "cloudbrain.delete_task"}}
  549. </div>
  550. <div class="content">
  551. <p>{{.i18n.Tr "cloudbrain.task_delete_confirm"}}</p>
  552. </div>
  553. <div class="actions">
  554. <div class="ui red basic inverted cancel button">
  555. <i class="remove icon"></i> {{.i18n.Tr "cloudbrain.operate_cancel"}}
  556. </div>
  557. <div class="ui green basic inverted ok button">
  558. <i class="checkmark icon"></i> {{.i18n.Tr "cloudbrain.operate_confirm"}}
  559. </div>
  560. </div>
  561. </div>
  562. </div>
  563. <!-- 创建模型 -->
  564. <div id="newmodel">
  565. <div class="ui modal second">
  566. <div class="header" style="padding: 1rem;background-color: rgba(240, 240, 240, 100);">
  567. <h4 id="model_header">{{.i18n.Tr "repo.model.manage.import_new_model"}}</h4>
  568. </div>
  569. <div class="content content-padding">
  570. <form id="formId" method="POST" class="ui form">
  571. <div class="ui error message">
  572. </div>
  573. {{$.CsrfTokenHtml}}
  574. <input type="hidden" name="trainTaskCreate" value="true">
  575. <div class="required inline field">
  576. <label>{{.i18n.Tr "repo.modelarts.train_job"}}</label>
  577. <input type="hidden" class="width83" id="jobId" name="jobId" readonly required>
  578. <input type="hidden" id="versionName" name="versionName" value="V0001">
  579. <input style="width: 45%;" id="JobName" readonly required>
  580. </div>
  581. <div class="required inline field" id="modelname">
  582. <label>{{.i18n.Tr "repo.model.manage.model_name"}}</label>
  583. <input style="width: 45%;" id="name" name="name" required maxlength="25"
  584. onkeyup="this.value=this.value.replace(/[, ]/g,'')">
  585. </div>
  586. <div class="required inline field" id="verionname">
  587. <label>{{.i18n.Tr "repo.modelconvert.modelversion"}}</label>
  588. <input style="width: 45%;" id="version" name="version" value="" readonly required maxlength="255">
  589. </div>
  590. <div class="unite min_title inline field required">
  591. <label>{{.i18n.Tr "repo.model.manage.engine"}}</label>
  592. <div class="ui dropdown selection search width70" id="choice_Engine">
  593. <input type="hidden" id="engine" name="engine" required>
  594. <div class="default text">{{.i18n.Tr "repo.model.manage.select.engine"}}</div>
  595. <i class="dropdown icon"></i>
  596. <div class="menu" id="job-Engine">
  597. <option class="active item" data-value="0">PyTorch</option>
  598. <option class="item" data-value="1">TensorFlow</option>
  599. <option class="item" data-value="2">MindSpore</option>
  600. <option class="item" data-value="4">PaddlePaddle</option>
  601. <option class="item" data-value="5">OneFlow</option>
  602. <option class="item" data-value="6">MXNet</option>
  603. <option class="item" data-value="3">Other</option>
  604. </div>
  605. </div>
  606. </div>
  607. <div class="unite min_title inline fields required">
  608. <div class="field required">
  609. <label for="modelSelectedFile">{{.i18n.Tr "repo.model.manage.modelfile"}}</label>
  610. </div>
  611. <div class="thirteen wide field" style="position:relative">
  612. <input id="modelSelectedFile" type="text" readonly required onclick="showMenu();" name="modelSelectedFile" >
  613. <div id="menuContent" class="menuContent" style="display:none;">
  614. <ul id="treeDemo" class="ztree"></ul>
  615. </div>
  616. </div>
  617. </div>
  618. <div class="inline field">
  619. <label>{{.i18n.Tr "repo.model.manage.modellabel"}}</label>
  620. <input style="width: 83%;margin-left: 7px;" id="label" name="label" maxlength="255"
  621. placeholder='{{.i18n.Tr "repo.modelarts.train_job.label_place"}}'>
  622. </div>
  623. <div class="inline fields">
  624. <label>{{.i18n.Tr "repo.model.manage.modelaccess"}}&nbsp;&nbsp;&nbsp;</label>
  625. <div class="field">
  626. <div class="ui radio checkbox">
  627. <input type="radio" name="isPrivate" checked="checked" value="false">
  628. <label>{{.i18n.Tr "repo.model.manage.modelaccess.public"}}</label>
  629. </div>
  630. </div>
  631. <div class="field">
  632. <div class="ui radio checkbox">
  633. <input type="radio" name="isPrivate" value="true">
  634. <label>{{.i18n.Tr "repo.model.manage.modelaccess.private"}}</label>
  635. </div>
  636. </div>
  637. </div>
  638. <div class="inline field">
  639. <label for="description">{{.i18n.Tr "repo.model.manage.modeldesc"}}</label>
  640. <textarea style="width: 83%;margin-left: 7px;" id="description" name="description" rows="3"
  641. maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.new_place"}}'
  642. onchange="this.value=this.value.substring(0, 255)"
  643. onkeydown="this.value=this.value.substring(0, 255)"
  644. onkeyup="this.value=this.value.substring(0, 256)"></textarea>
  645. </div>
  646. <div class="inline field" style="margin-left: 75px;">
  647. <button onclick="createModel()" type="button" class="ui create_train_job green button"
  648. style="position: absolute;">
  649. {{.i18n.Tr "repo.model.manage.sava_model"}}
  650. </button>
  651. </div>
  652. </form>
  653. <div class="actions" style="display: inline-block;margin-left: 180px;">
  654. <button class="ui button cancel">{{.i18n.Tr "repo.cloudbrain.cancel"}}</button>
  655. </div>
  656. </div>
  657. </div>
  658. </div>
  659. </div>
  660. {{template "base/footer" .}}
  661. <script type="text/javascript" src="/self/ztree/js/jquery.ztree.core.js"></script>
  662. <script type="text/javascript" src="/self/ztree/js/jquery.ztree.excheck.js"></script>
  663. <script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script>
  664. <script>
  665. ;(function() {
  666. var SPEC = {{ .Spec }};
  667. var showPoint = false;
  668. var specStr = window.renderSpecStr(SPEC, showPoint, {
  669. gpu_memory: {{$.i18n.Tr "cloudbrain.gpu_memory"}},
  670. free: {{$.i18n.Tr "cloudbrain.free"}},
  671. point_hr: {{$.i18n.Tr "cloudbrain.point_hr"}},
  672. memory: {{$.i18n.Tr "cloudbrain.memory"}},
  673. shared_memory: {{$.i18n.Tr "cloudbrain.shared_memory"}},
  674. });
  675. $('td.ti-text-form-content.spec').text(specStr);
  676. })();
  677. var setting = {
  678. check: {
  679. enable: true,
  680. chkboxType: {"Y":"ps", "N":"ps"}
  681. },
  682. view: {
  683. dblClickExpand: false
  684. },
  685. callback: {
  686. beforeClick: beforeClick,
  687. onCheck: onCheck
  688. }
  689. };
  690. function beforeClick(treeId, treeNode) {
  691. var zTree = $.fn.zTree.getZTreeObj("treeDemo");
  692. zTree.checkNode(treeNode, !treeNode.checked, null, true);
  693. return false;
  694. }
  695. function onCheck(e, treeId, treeNode) {
  696. var zTree = $.fn.zTree.getZTreeObj("treeDemo"),
  697. nodes = zTree.getCheckedNodes(true),
  698. v = "";
  699. for (var i=0, l=nodes.length; i<l; i++) {
  700. if(nodes[i].isParent){
  701. continue;
  702. }
  703. var pathNodes = nodes[i].getPath();
  704. var path ="";
  705. for(var j=0;j<pathNodes.length;j++){
  706. if(j ==0){
  707. path += pathNodes[j].name;
  708. }else{
  709. path += "/" + pathNodes[j].name;
  710. }
  711. }
  712. v += path + ";";
  713. }
  714. if (v.length > 0 ) v = v.substring(0, v.length-1);
  715. var cityObj = $("#modelSelectedFile");
  716. cityObj.attr("value", v);
  717. }
  718. function showMenu() {
  719. var cityObj = $("#modelSelectedFile");
  720. var cityOffset = $("#modelSelectedFile").offset();
  721. $("#menuContent").slideDown("fast");
  722. $("body").bind("mousedown", onBodyDown);
  723. }
  724. function hideMenu() {
  725. $("#menuContent").fadeOut("fast");
  726. $("body").unbind("mousedown", onBodyDown);
  727. }
  728. function onBodyDown(event) {
  729. if (!(event.target.id == "menuBtn" || event.target.id == "modelSelectedFile" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
  730. hideMenu();
  731. }
  732. }
  733. let dirKey="isOnlyDir--:&";
  734. function loadSelectedModelFile(trainJob){
  735. console.log("trainJob=" + trainJob);
  736. $('#choice_file').dropdown('clear')
  737. $("#model-file").empty()
  738. if(trainJob ==null || trainJob ==""){
  739. console.log("trainJob is null");
  740. }else{
  741. let type = trainJob.Type;
  742. if(type == 2){
  743. if(trainJob.ComputeResource=="NPU"){
  744. type=1;
  745. }else{
  746. type=0;
  747. }
  748. }
  749. $.get(`/${userName}/${repoPath}/modelmanage/query_train_model?jobName=${trainJob.JobName}&type=${type}&VersionName=${trainJob.VersionName}`, (data) => {
  750. const n_length = data.length
  751. let file_html=''
  752. let firstFileName =''
  753. var zNodes=[];
  754. var nodesMap={};
  755. for (let i=0;i<n_length;i++){
  756. var parentNodeMap = nodesMap;
  757. var fileSplits = data[i].FileName.split("/");
  758. for(let j=0;j < fileSplits.length;j++){
  759. if(fileSplits[j] == ""){
  760. break;
  761. }
  762. if(parentNodeMap[fileSplits[j]] == null){
  763. parentNodeMap[fileSplits[j]] = {};
  764. }
  765. parentNodeMap = parentNodeMap[fileSplits[j]];
  766. }
  767. }
  768. for (let i=0;i<n_length;i++){
  769. var parentNodeMap = nodesMap;
  770. var fileSplits = data[i].FileName.split("/");
  771. for(let j=0;j < fileSplits.length;j++){
  772. if(fileSplits[j] == ""){
  773. if(data[i].FileName[data[i].FileName.length -1] =="/"){
  774. if(Object.keys(parentNodeMap).length ==0){
  775. parentNodeMap[dirKey]="true";
  776. }
  777. }
  778. break;
  779. }
  780. parentNodeMap = parentNodeMap[fileSplits[j]];
  781. }
  782. }
  783. convertToNode(zNodes,nodesMap);
  784. $.fn.zTree.init($("#treeDemo"), setting, zNodes);
  785. })
  786. }
  787. }
  788. function convertToNode(nodeList,nodesMap){
  789. var keyList = Object.keys(nodesMap);
  790. keyList.sort(function(a,b){
  791. return a-b;
  792. });
  793. var isFirst = true;
  794. for(var i=0; i<keyList.length;i++){
  795. var node = {};
  796. node["name"] = keyList[i];
  797. nodeList.push(node);
  798. if(nodesMap[keyList[i]] != null && Object.keys(nodesMap[keyList[i]]).length >0){
  799. if(nodesMap[keyList[i]][dirKey] != null){
  800. node["open"] = false;
  801. node["isParent"] = true;
  802. }else{
  803. node["children"]=[];
  804. if(isFirst){
  805. node["open"] = true;
  806. isFirst= false;
  807. }
  808. convertToNode(node["children"],nodesMap[keyList[i]]);
  809. }
  810. }
  811. }
  812. }
  813. function showcreate(obj) {
  814. $('.ui.modal.second')
  815. .modal({
  816. centered: false,
  817. onShow: function () {
  818. $('input[name="version"]').addClass('model_disabled')
  819. $('#JobName').val(obj.DisplayJobName).addClass('model_disabled')
  820. $('input[name="jobId"]').val(obj.JobID)
  821. $('input[name="versionName"]').val("V0001")
  822. if(obj.ComputeResource=="NPU"){
  823. if (obj.EngineName != null && obj.EngineName != "") {
  824. srcEngine = obj.EngineName.split('-')[0]
  825. srcEngine = srcEngine.trim().toLowerCase();
  826. if (srcEngine == 'tensorflow') {
  827. $('#choice_Engine .default.text').text("TensorFlow");
  828. $('#choice_Engine input[name="engine"]').val(1)
  829. }
  830. if (srcEngine == 'mindspore') {
  831. $('#choice_Engine .default.text').text("MindSpore");
  832. $('#choice_Engine input[name="engine"]').val(2)
  833. }
  834. }
  835. }else{
  836. $('#choice_Engine .default.text').text("PyTorch");
  837. $('#choice_Engine input[name="engine"]').val(0)
  838. }
  839. $('#choice_Engine .default.text').css({ "color": "rgb(0, 0, 0,0.87)" })
  840. $('.ui.dimmer').css({ "background-color": "rgb(136, 136, 136,0.7)" })
  841. createModelName();
  842. loadSelectedModelFile(obj);
  843. },
  844. onHide: function () {
  845. $('.ui.dimmer').css({ "background-color": "" })
  846. $('.ui.error.message').text()
  847. $('.ui.error.message').css('display', 'none')
  848. }
  849. })
  850. .modal('show')
  851. }
  852. function createModel() {
  853. if(!$('input#modelSelectedFile').val()){
  854. $('input#modelSelectedFile').parent().addClass('error')
  855. return
  856. }
  857. let url_href = `/${userName}/${repoPath}/modelmanage/create_new_model`
  858. let data = $("#formId").serialize()
  859. var radio = document.getElementsByName("isPrivate");
  860. if(radio == null || radio.length == 0){
  861. data +="&isPrivate=true";
  862. }
  863. $("#mask").css({ "display": "block", "z-index": "9999" })
  864. $.ajax({
  865. url: url_href,
  866. type: 'POST',
  867. data: data,
  868. success: function (res) {
  869. $('input[name="engine_name"]').val("");
  870. $('input[name="engine"]').val("");
  871. $('input[name="jobId"]').val("");
  872. $('input[name="label"]').val("");
  873. $('input[name="description"]').val("");
  874. var cityObj = $("#modelSelectedFile");
  875. cityObj.attr("value", "");
  876. document.getElementById("formId").reset();
  877. location.href = `/${userName}/${repoPath}/modelmanage/show_model`
  878. $('.ui.modal.second').modal('hide')
  879. },
  880. error: function (xhr) {
  881. // 隐藏 loading
  882. // 只有请求不正常(状态码不为200)才会执行
  883. $('.ui.error.message').text(xhr.responseText)
  884. $('.ui.error.message').css('display', 'block')
  885. },
  886. complete: function (xhr) {
  887. $("#mask").css({ "display": "none", "z-index": "1" })
  888. }
  889. })
  890. }
  891. function createModelName() {
  892. let repoName = location.pathname.split('/')[2]
  893. let modelName = repoName + '_model_' + Math.random().toString(36).substr(2, 4)
  894. $('#name').val(modelName)
  895. $('#version').val("0.0.1")
  896. }
  897. $('.menu .item').tab()
  898. $(document).ready(function () {
  899. $('.ui.accordion').accordion({ selector: { trigger: '.icon' } });
  900. });
  901. $(document).ready(function () {
  902. $('.secondary.menu .item').tab();
  903. });
  904. let userName
  905. let repoPath
  906. let jobID
  907. let downlaodFlag = {{ $.canDownload }}
  908. $(document).ready(function () {
  909. let url = window.location.href;
  910. let urlArr = url.split('/')
  911. userName = urlArr.slice(-5)[0]
  912. repoPath = urlArr.slice(-4)[0]
  913. jobID = urlArr.slice(-1)[0]
  914. })
  915. function stopBubbling(e) {
  916. e = window.event || e;
  917. if (e.stopPropagation) {
  918. e.stopPropagation(); //阻止事件 冒泡传播
  919. } else {
  920. e.cancelBubble = true; //ie兼容
  921. }
  922. }
  923. function renderSize(value) {
  924. if (null == value || value == '') {
  925. return "0 Bytes";
  926. }
  927. var unitArr = new Array("Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB");
  928. var index = 0;
  929. var srcsize = parseFloat(value);
  930. index = Math.floor(Math.log(srcsize) / Math.log(1024));
  931. var size = srcsize / Math.pow(1024, index);
  932. size = size.toFixed(0);//保留的小数位数
  933. return size + unitArr[index];
  934. }
  935. </script>