Browse Source

fix issue

tags/v1.22.1.2
zhoupzh 3 years ago
parent
commit
bf6e9ac911
7 changed files with 156 additions and 11 deletions
  1. +1
    -0
      options/locale/locale_en-US.ini
  2. +1
    -0
      options/locale/locale_zh-CN.ini
  3. +4
    -4
      templates/repo/modelarts/inferencejob/index.tmpl
  4. +123
    -0
      templates/repo/modelarts/inferencejob/new.tmpl
  5. +7
    -4
      templates/repo/modelarts/inferencejob/show.tmpl
  6. +19
    -3
      templates/repo/modelmanage/index.tmpl
  7. +1
    -0
      web_src/js/components/Model.vue

+ 1
- 0
options/locale/locale_en-US.ini View File

@@ -832,6 +832,7 @@ modelarts.notebook=Debug Task
modelarts.train_job=Train Task
modelarts.train_job.new_debug= New Debug Task
modelarts.train_job.new_train=New Train Task
modelarts.train_job.new_infer=New Inference Task
modelarts.train_job.config=Configuration information
modelarts.train_job.new=New train Task
modelarts.train_job.new_place=The description should not exceed 256 characters


+ 1
- 0
options/locale/locale_zh-CN.ini View File

@@ -838,6 +838,7 @@ modelarts.notebook=调试任务
modelarts.train_job=训练任务
modelarts.train_job.new_debug=新建调试任务
modelarts.train_job.new_train=新建训练任务
modelarts.train_job.new_infer=新建推理任务
modelarts.train_job.config=配置信息
modelarts.train_job.new=新建训练任务
modelarts.train_job.new_place=描述字数不超过256个字符


+ 4
- 4
templates/repo/modelarts/inferencejob/index.tmpl View File

@@ -39,9 +39,9 @@
</div>
<div class="column right aligned">
{{if .Permission.CanWrite $.UnitTypeCloudBrain}}
<a class="ui green button" href="{{.RepoLink}}/modelarts/inference-job/create">{{$.i18n.Tr "repo.modelarts.train_job.new_train"}}</a>
<a class="ui green button" href="{{.RepoLink}}/modelarts/inference-job/create">{{$.i18n.Tr "repo.modelarts.train_job.new_infer"}}</a>
{{else}}
<a class="ui disabled button" >{{$.i18n.Tr "repo.modelarts.train_job.new_train"}}</a>
<a class="ui disabled button" >{{$.i18n.Tr "repo.modelarts.train_job.new_infer"}}</a>
{{end}}
</div>
</div>
@@ -156,7 +156,7 @@
<!-- 下载 -->
<div class="ui compact buttons">
{{$.CsrfTokenHtml}}
{{if .CanDel}}
{{if $.canDownload}}
<a style="padding: 0.5rem 1rem;margin-left:0.2rem" id="model-download-{{.JobID}}" href="{{$.RepoLink}}/modelarts/inference-job/{{.JobID}}/downloadall?version_name={{.VersionName}}" class="ui basic blue button" style="border-radius: .28571429rem;">
{{$.i18n.Tr "repo.download"}}
</a>
@@ -261,7 +261,7 @@ function deleteVersion(version_name,jobID){
});
}
function stopVersion(version_name,jobID){
const url = '/api/v1/repos/{{$.RepoRelPath}}/modelarts//inference-job/'+jobID+'/stop_version'
const url = '/api/v1/repos/{{$.RepoRelPath}}/modelarts/inference-job/'+jobID+'/stop_version'
$.post(url,{version_name:version_name},(data)=>{
if(data.StatusOK===0){
$('#'+version_name+'-stop').removeClass('blue')


+ 123
- 0
templates/repo/modelarts/inferencejob/new.tmpl View File

@@ -97,8 +97,14 @@
<div class="required eight wide field">
<label style="font-weight: normal;white-space: nowrap;">{{.i18n.Tr "repo.modelarts.infer_job.select_model"}}&nbsp;&nbsp;</label>
<div class="ui fluid search selection dropdown loading" id="select_model">
{{if $.ckpt_name}}
<input type="hidden" name="model_name" value="{{$.model_name}}" required>
<div class="text">{{$.model_name}}</div>
{{else}}
<input type="hidden" name="model_name" required>
<div class="default text">选择项目下的模型</div>
{{end}}
<i class="dropdown icon"></i>
<div class="menu" id="model_name">
</div>
@@ -107,8 +113,13 @@
</div>
<div class="three wide field">
<div class="ui fluid search selection dropdown" id="select_model_version">
{{if $.ckpt_name}}
<input type="hidden" name="train_url" value="{{$.model_version}}" required>
<div class="text">{{$.model_version}}</div>
{{else}}
<input type="hidden" name="train_url" required>
<div class="default text">选择版本</div>
{{end}}
<i class="dropdown icon"></i>
<div class="menu" id="model_name_version">
</div>
@@ -117,8 +128,13 @@
</div>
<div class="five wide field">
<div class="ui fluid search selection dropdown" id="select_model_checkpoint">
{{if $.ckpt_name}}
<input type="hidden" name="ckpt_name" value="{{$.ckpt_name}}" required>
<div class="text">{{$.ckpt_name}}</div>
{{else}}
<input type="hidden" name="ckpt_name" required>
<div class="default text">选择模型.ckpt文件</div>
{{end}}
<i class="dropdown icon"></i>
<div class="menu" id="model_checkpoint">
</div>
@@ -414,8 +430,115 @@
$("input#ai_flaver_name").val(name2)

}

$('.ui.form')
.form({
on: 'blur',
inline:true,
fields: {
boot_file: {
identifier : 'boot_file',
rules: [
{
type: 'regExp[/.+\.py$/g]',
prompt : '启动文件必须为.py结尾'
}
]
},
job_name:{
identifier : 'job_name',
rules: [
{
type: 'regExp[/^[a-zA-Z0-9-_]{1,36}$/]',
prompt : '只包含大小写字母、数字、_和-,最长36个字符。'
}
]
},
attachment:{
identifier : 'attachment',
rules: [
{
type: 'empty',
prompt : '选择一个数据集'
}
]

},
work_server_number: {
identifier : 'work_server_number',
rules: [
{
type : 'integer[1..25]',
prompt : '计算节点需要在1-25之间,请您键入正确的值'
}
]
}
},
})



function validate(){
$('.ui.form')
.form({
on: 'blur',
inline:true,
fields: {
boot_file: {
identifier : 'boot_file',
rules: [
{
type: 'regExp[/.+\.py$/g]',
prompt : '启动文件必须为.py结尾'
}
]
},
job_name:{
identifier : 'job_name',
rules: [
{
type: 'regExp[/^[a-zA-Z0-9-_]{1,36}$/]',
prompt : '只包含大小写字母、数字、_和-,最长36个字符。'
}
]
},
attachment:{
identifier : 'attachment',
rules: [
{
type: 'empty',
prompt : '选择一个数据集'
}
]

},
work_server_number: {
identifier : 'work_server_number',
rules: [
{
type : 'integer[1..25]',
prompt : '计算节点需要在1-25之间,请您键入正确的值'
}
]
}
},
onSuccess: function(){
// $('.ui.page.dimmer').dimmer('show')
document.getElementById("mask").style.display = "block"
},
onFailure: function(e){
return false;
}
})
}
document.onreadystatechange = function() {
if (document.readyState === "complete") {
document.getElementById("mask").style.display = "none"
}
}
$('.ui.create_train_job.green.button').click(function(e) {
send_run_para()
get_name()
validate()
})
</script>

+ 7
- 4
templates/repo/modelarts/inferencejob/show.tmpl View File

@@ -171,14 +171,14 @@ td, th {
</a>
<div class="divider"> / </div>
<a class="section" href="{{$.RepoLink}}/modelarts/inference-job">
{{$.i18n.Tr "repo.modelarts.train_job"}}
{{$.i18n.Tr "repo.modelarts.infer_job"}}
</a>
<div class="divider"> / </div>
<div class="active section">{{.jobName}}</div>
</div>
</h4>
{{with .task}}
<div class="content-pad">
<div class="content-pad" style="border: 1px solid #e2e2e2;margin-top: 24px;padding: 20px 60px 40px 60px;">
<div class="ui pointing secondary menu" style="border-bottom: 1px solid rgba(34,36,38,.15);">
<a class="active item" data-tab="first">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a>
@@ -254,8 +254,11 @@ td, th {
<td class="ti-text-form-content">
<div class="text-span text-span-w" id="{{.VersionName}}-labels">
{{if .LabelName}}
<span>{{.LabelName}}</span>
{{range $.labelName}}
<a class="ui label" title="{{.}}">{{.}}</a>
{{end}}
{{else}}
<span>--</span>
{{end}}
@@ -285,7 +288,7 @@ td, th {
<td class="ti-text-form-content">
<div class="text-span text-span-w" id="{{.VersionName}}-creator">
--
{{$.userName}}
</div>
</td>
</tr>


+ 19
- 3
templates/repo/modelmanage/index.tmpl View File

@@ -17,16 +17,30 @@
<div class="repository release dataset-list view">
{{template "repo/header" .}}
<!-- 列表容器 -->
<div class="ui container active loader" id="loadContainer">
<div class="ui container {{if ne $.MODEL_COUNT 0}}active loader {{end}}" id="loadContainer">
{{template "base/alert" .}}
<div class="ui two column stackable grid" style="display: none;">
<div class="ui two column stackable grid">
<div class="column"></div>
<div class="column right aligned">
<!-- -->
<a class="ui button {{if .Permission.CanWrite $.UnitTypeCloudBrain}} green {{else}} disabled {{end}}" onclick="showcreate(this)">{{$.i18n.Tr "repo.model.manage.import_new_model"}}</a>
</div>
</div>

{{if eq $.MODEL_COUNT 0}}
<div class="ui placeholder segment bgtask-none">
<div class="ui icon header bgtask-header-pic"></div>
<div class="bgtask-content-header">未创建过模型</div>
<div class="bgtask-content">
{{if $.RepoIsEmpty}}
<div class="bgtask-content-txt">代码版本:您还没有初始化代码仓库,请先<a href="{{.RepoLink}}">创建代码版本;</a></div>
{{end}}
{{if eq $.TRAIN_COUNT 0}}
<div class="bgtask-content-txt">训练任务:你还没创建过训练任务,请先创建训练任务。</div>
{{end}}
<div class="bgtask-content-txt">使用说明:可以参考启智AI协作平台<a href="https://git.openi.org.cn/zeizei/OpenI_Learning">小白训练营课程。</a></div>
</div>
</div>
{{else}}
<!-- 中下列表展示区 -->
<div class="ui grid" style="display: none;">
<div class="row" style="padding-top: 0;">
@@ -38,6 +52,7 @@
</div>
</div>
</div>
{{end}}

</div>

@@ -139,6 +154,7 @@
{{template "base/footer" .}}

<script>
console.log({{.MODEL_COUNT}})
let repolink = {{.RepoLink}}
let repoId = {{$repository}}
const {_AppSubUrl, _StaticUrlPrefix, csrf} = window.config;


+ 1
- 0
web_src/js/components/Model.vue View File

@@ -348,6 +348,7 @@ export default {
this.$axios.get(location.href+'_api',{
params:this.params
}).then((res)=>{
console.log(res)
$(".ui.grid").removeAttr("style")
$("#loadContainer").removeClass("loader")
let TrainTaskInfo


Loading…
Cancel
Save