Browse Source

Merge branch 'V20220908' of git.openi.org.cn:OpenI/aiforge into cd-notebook

tags/v1.22.9.1^2
lewis 3 years ago
parent
commit
6ab10babca
26 changed files with 234 additions and 102 deletions
  1. +4
    -2
      models/cloudbrain.go
  2. +19
    -16
      models/dataset.go
  3. +1
    -1
      modules/cloudbrain/resty.go
  4. +12
    -8
      options/locale/locale_en-US.ini
  5. +7
    -2
      options/locale/locale_zh-CN.ini
  6. +1
    -1
      routers/repo/cloudbrain.go
  7. +4
    -0
      routers/repo/dataset.go
  8. +1
    -1
      routers/repo/grampus.go
  9. +45
    -26
      routers/repo/modelarts.go
  10. +1
    -1
      templates/custom/wait_count_train.tmpl
  11. +7
    -1
      templates/repo/cloudbrain/inference/show.tmpl
  12. +7
    -1
      templates/repo/cloudbrain/show.tmpl
  13. +8
    -2
      templates/repo/cloudbrain/trainjob/show.tmpl
  14. +1
    -1
      templates/repo/datasets/index.tmpl
  15. +7
    -2
      templates/repo/grampus/trainjob/show.tmpl
  16. +8
    -1
      templates/repo/modelarts/inferencejob/show.tmpl
  17. +8
    -1
      templates/repo/modelarts/notebook/show.tmpl
  18. +8
    -2
      templates/repo/modelarts/trainjob/show.tmpl
  19. +41
    -3
      templates/repo/modelarts/trainjob/version_new.tmpl
  20. +2
    -2
      templates/repo/modelmanage/convertIndex.tmpl
  21. +3
    -3
      templates/repo/modelmanage/index.tmpl
  22. +1
    -1
      templates/repo/modelmanage/showinfo.tmpl
  23. +2
    -1
      web_src/js/components/Model.vue
  24. +1
    -1
      web_src/js/components/dataset/referenceDataset.vue
  25. +28
    -19
      web_src/js/components/dataset/selectDataset.vue
  26. +7
    -3
      web_src/js/features/i18nVue.js

+ 4
- 2
models/cloudbrain.go View File

@@ -72,6 +72,7 @@ const (
ModelArtsStopping ModelArtsJobStatus = "STOPPING" //停止中
ModelArtsStopped ModelArtsJobStatus = "STOPPED" //停止
ModelArtsUnavailable ModelArtsJobStatus = "UNAVAILABLE" //故障
ModelArtsDeleting ModelArtsJobStatus = "DELETING" //删除中
ModelArtsDeleted ModelArtsJobStatus = "DELETED" //已删除
ModelArtsResizing ModelArtsJobStatus = "RESIZING" //规格变更中
ModelArtsResizFailed ModelArtsJobStatus = "RESIZE_FAILED" //规格变更失败
@@ -1085,6 +1086,7 @@ type DatasetDownload struct {
DatasetName string `json:"dataset_name"`
DatasetDownloadLink string `json:"dataset_download_link"`
RepositoryLink string `json:"repository_link"`
IsDelete bool `json:"is_delete"`
}

type DataSource struct {
@@ -1920,9 +1922,9 @@ func GetCloudbrainCountByUserID(userID int64, jobType string) (int, error) {

func GetCloudbrainRunCountByRepoID(repoID int64) (int, error) {
count, err := x.In("status", JobWaiting, JobRunning, ModelArtsCreateQueue, ModelArtsCreating, ModelArtsStarting,
ModelArtsReadyToStart, ModelArtsResizing, ModelArtsStartQueuing, ModelArtsRunning, ModelArtsRestarting, ModelArtsTrainJobInit,
ModelArtsReadyToStart, ModelArtsResizing, ModelArtsStartQueuing, ModelArtsRunning, ModelArtsDeleting, ModelArtsRestarting, ModelArtsTrainJobInit,
ModelArtsTrainJobImageCreating, ModelArtsTrainJobSubmitTrying, ModelArtsTrainJobWaiting, ModelArtsTrainJobRunning, ModelArtsStopping, ModelArtsResizing,
ModelArtsTrainJobScaling, ModelArtsTrainJobCheckInit, ModelArtsTrainJobCheckRunning, ModelArtsTrainJobCheckRunningCompleted).And("repo_id = ?", repoID).Count(new(Cloudbrain))
ModelArtsTrainJobScaling, ModelArtsTrainJobCheckInit, ModelArtsTrainJobCheckRunning, ModelArtsTrainJobKilling, ModelArtsTrainJobCheckRunningCompleted).And("repo_id = ?", repoID).Count(new(Cloudbrain))
return int(count), err
}



+ 19
- 16
models/dataset.go View File

@@ -121,8 +121,10 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions)

for i := range datasets {
if attachment.DatasetID == datasets[i].ID {
if opts.StarByMe {

if !attachment.IsPrivate{
datasets[i].Attachments = append(datasets[i].Attachments, attachment)
}else{
permission, ok := permissionMap[datasets[i].ID]
if !ok {

@@ -136,7 +138,7 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions)
}
if !permission {
isCollaborator, _ := datasets[i].Repo.IsCollaborator(opts.User.ID)
if isCollaborator {
if isCollaborator ||datasets[i].Repo.IsOwnedBy(opts.User.ID){
log.Info("Collaborator user may visit the attach.")
permission = true
}
@@ -147,11 +149,7 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions)

if permission {
datasets[i].Attachments = append(datasets[i].Attachments, attachment)
} else if !attachment.IsPrivate {
datasets[i].Attachments = append(datasets[i].Attachments, attachment)
}
} else {
datasets[i].Attachments = append(datasets[i].Attachments, attachment)
}

}
@@ -171,16 +169,17 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions)
}

type SearchDatasetOptions struct {
Keyword string
OwnerID int64
User *User
RepoID int64
IncludePublic bool
RecommendOnly bool
Category string
Task string
License string
DatasetIDs []int64
Keyword string
OwnerID int64
User *User
RepoID int64
IncludePublic bool
RecommendOnly bool
Category string
Task string
License string
DatasetIDs []int64
ExcludeDatasetId int64
ListOptions
SearchOrderBy
IsOwner bool
@@ -240,6 +239,10 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond {
cond = cond.And(builder.Eq{"dataset.repo_id": opts.RepoID})
}

if opts.ExcludeDatasetId > 0 {
cond = cond.And(builder.Neq{"dataset.id": opts.ExcludeDatasetId})
}

if opts.PublicOnly {
cond = cond.And(builder.Eq{"dataset.status": DatasetStatusPublic})
cond = cond.And(builder.Eq{"attachment.is_private": false})


+ 1
- 1
modules/cloudbrain/resty.go View File

@@ -93,7 +93,7 @@ sendjob:
return nil, fmt.Errorf("resty get queues detail failed: %s", err)
}

if jobResult.Code == errInvalidToken && retry < 1 {
if (res.StatusCode() == http.StatusUnauthorized || jobResult.Code == errInvalidToken) && retry < 1 {
retry++
_ = loginCloudbrain()
goto sendjob


+ 12
- 8
options/locale/locale_en-US.ini View File

@@ -924,7 +924,7 @@ dataset_name_tooltips = Please enter letters, numbers, _ and - up to 100 charact
dataset_no_create = No dataset has been created yet
dataset_explain = Dataset: CloudBrain I provides CPU/GPU resources, Cloudbrain II provides Ascend NPU resources, and the data set used for debugging also needs to be uploaded to the corresponding environment;
dataset_instructions_for_use = Instructions for use: You can refer to Openi AI Collaboration Platform
dataset_camp_course = Newcomer Training Camp Course;
dataset_camp_course = OpenI_Learning;
dataset_upload = Upload
dataset_upload_status= Upload Status
dataset_file_name = File Name
@@ -959,6 +959,7 @@ unfavorite=Unlike
favorite=Like
disassociate=Disassociate
benchmark_dataset_tip=Note: first use the dataset function to upload the model, and then select the model from the dataset list.
file_deleted=The file has been deleted

[repo]
owner = Owner
@@ -1140,7 +1141,7 @@ modelarts.train_job.compute_node=Compute Node
modelarts.create_model = Create Model
modelarts.model_label=Model Label
modelarts.infer_dataset = Inference Dataset
modelarts.train_job.label_place=Input labels, multiple labels are separated by spaces

modelarts.train_job.basic_info=Basic Info
modelarts.train_job.job_status=Job Status
@@ -1221,7 +1222,10 @@ model_Evaluation_not_created = Model evaluation has not been created
repo_not_initialized = Code version: You have not initialized the code repository, please <a href="%s"> initialized </a> first ;
debug_task_running_limit =Running time: no more than 4 hours, it will automatically stop if it exceeds 4 hours;
dataset_desc = Dataset: Cloud Brain 1 provides CPU/GPU,Cloud Brain 2 provides Ascend NPU.And dataset also needs to be uploaded to the corresponding environment;
platform_instructions = Instructions for use: You can refer to the <a href="https://git.openi.org.cn/zeizei/OpenI_Learning">Xiaobai training camp </a> course of Openi AI collaboration platform.
platform_instructions = Instructions for use: You can refer to the <a href="https://git.openi.org.cn/zeizei/OpenI_Learning"> OpenI_Learning </a> course of Qizhi AI collaboration platform.
platform_instructions1 = Instructions for use: You can refer to the
platform_instructions2 = OpenI_Learning
platform_instructions3 = course of Openi AI collaboration platform.
model_not_exist = Model file: You do not have a model file yet, please generate and <a href="%s/modelmanage/show_model">export the model</a> through the <a href="%s/modelarts/train-job">training task</a> first ;
benchmark_leaderboards = Benchmark leaderboards

@@ -1244,11 +1248,11 @@ model.convert=Model Transformation
model.list=Model List
model.manage.create_new_convert_task=Create Model Transformation Task

model.manage.notcreatemodel=No model has been created.
model.manage.notcreatemodel=No model has been created
model.manage.init1=Code version: You have not initialized the code repository, please
model.manage.init2=initialized first ;
model.manage.createtrainjob_tip=Training task: you haven't created a training task, please create it first
model.manage.createtrainjob=Training task
model.manage.createtrainjob=Training task.
model.manage.delete=Delete Model
model.manage.delete_confirm=Are you sure to delete this model? Once this model is deleted, it cannot be restored.
model.manage.select.trainjob=Select train task
@@ -1260,9 +1264,9 @@ model.manage.modellabel=Model label
model.manage.modeldesc=Model description
model.manage.baseinfo=Base Information
modelconvert.notcreate=No model conversion task has been created.
modelconvert.importfirst1=Please import first
modelconvert.importfirst2=download model
modelconvert.importfirst3=, then converts it.
modelconvert.importfirst1=Please import the
modelconvert.importfirst2=model
modelconvert.importfirst3=first, then converts it.
modelconvert.download=Download
modelconvert.taskname=Task name
modelconvert.modelname=Model name


+ 7
- 2
options/locale/locale_zh-CN.ini View File

@@ -965,6 +965,7 @@ unfavorite=取消收藏
favorite=收藏
disassociate=取消关联
benchmark_dataset_tip=说明:先使用数据集功能上传模型,然后从数据集列表选模型。
file_deleted=文件已经被删除

[repo]
owner=拥有者
@@ -1235,6 +1236,10 @@ repo_not_initialized = 代码版本:您还没有初始化代码仓库,请先
debug_task_running_limit = 运行时长:最长不超过4个小时,超过4个小时将自动停止;
dataset_desc = 数据集:云脑1提供 CPU / GPU 资源,云脑2提供 Ascend NPU 资源,调试使用的数据集也需要上传到对应的环境;
platform_instructions = 使用说明:可以参考启智AI协作平台<a href="https://git.openi.org.cn/zeizei/OpenI_Learning">小白训练营课程</a>。
platform_instructions1 = 使用说明:可以参考启智AI协作平台
platform_instructions2 = 小白训练营课程
platform_instructions3 = 。

model_not_exist = 模型文件:您还没有模型文件,请先通过<a href="%s/modelarts/train-job">训练任务</a>产生并 <a href="%s/modelmanage/show_model">导出模型</a> ;
benchmark_leaderboards = 基准测试排行榜

@@ -1261,7 +1266,7 @@ model.manage.notcreatemodel=未创建过模型
model.manage.init1=代码版本:您还没有初始化代码仓库,请先
model.manage.init2=创建代码版本;
model.manage.createtrainjob_tip=训练任务:您还没创建过训练任务,请先创建
model.manage.createtrainjob=训练任务
model.manage.createtrainjob=训练任务
model.manage.delete=删除模型
model.manage.delete_confirm=你确认删除该模型么?此模型一旦删除不可恢复。
model.manage.select.trainjob=选择训练任务
@@ -1274,7 +1279,7 @@ model.manage.modeldesc=模型描述
model.manage.baseinfo=基本信息
modelconvert.notcreate=未创建过模型转换任务
modelconvert.importfirst1=请您先导入
modelconvert.importfirst2=模型下载
modelconvert.importfirst2=模型
modelconvert.importfirst3=,然后再对其进行转换。
modelconvert.download=下载
modelconvert.taskname=任务名称


+ 1
- 1
routers/repo/cloudbrain.go View File

@@ -928,7 +928,7 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo
}

}
ctx.Data["datasetDownload"] = GetCloudBrainDataSetInfo(task.Uuid, false)
ctx.Data["datasetDownload"] = GetCloudBrainDataSetInfo(task.Uuid, task.DatasetName, false)
ctx.Data["task"] = task
labelName := strings.Fields(task.LabelName)
ctx.Data["LabelName"] = labelName


+ 4
- 0
routers/repo/dataset.go View File

@@ -529,6 +529,10 @@ func ReferenceDatasetAvailable(ctx *context.Context) {
NeedAttachment: false,
CloudBrainType: models.TypeCloudBrainAll,
}
dataset, _ := models.GetDatasetByRepo(&models.Repository{ID: ctx.Repo.Repository.ID})
if dataset != nil {
opts.ExcludeDatasetId = dataset.ID
}
datasetMultiple(ctx, opts)

}


+ 1
- 1
routers/repo/grampus.go View File

@@ -713,7 +713,7 @@ func GrampusTrainJobShow(ctx *context.Context) {
taskList := make([]*models.Cloudbrain, 0)
taskList = append(taskList, task)
ctx.Data["version_list_task"] = taskList
ctx.Data["datasetDownload"] = GetCloudBrainDataSetInfo(task.Uuid, false)
ctx.Data["datasetDownload"] = GetCloudBrainDataSetInfo(task.Uuid, task.DatasetName, false)
ctx.Data["canDownload"] = cloudbrain.CanModifyJob(ctx, task)
ctx.Data["displayJobName"] = task.DisplayJobName



+ 45
- 26
routers/repo/modelarts.go View File

@@ -238,7 +238,7 @@ func NotebookShow(ctx *context.Context) {
datasetDownload := make([]models.DatasetDownload, 0)
if ctx.IsSigned {
if task.Uuid != "" && task.UserID == ctx.User.ID {
datasetDownload = GetCloudBrainDataSetInfo(task.Uuid, true)
datasetDownload = GetCloudBrainDataSetInfo(task.Uuid, task.DatasetName, true)
}
}
user, err := models.GetUserByID(task.UserID)
@@ -281,36 +281,52 @@ func NotebookShow(ctx *context.Context) {
ctx.HTML(200, tplModelArtsNotebookShow)
}

func GetCloudBrainDataSetInfo(uuid string, isNeedDown bool) []models.DatasetDownload {
func GetCloudBrainDataSetInfo(uuid string, datasetname string, isNeedDown bool) []models.DatasetDownload {
datasetDownload := make([]models.DatasetDownload, 0)

if len(uuid) == 0 {
return datasetDownload
}
uuidList := strings.Split(uuid, ";")
for _, uuidStr := range uuidList {
datasetnameList := strings.Split(datasetname, ";")
for i, uuidStr := range uuidList {
name := ""
link := ""
url := ""
isDelete := false
attachment, err := models.GetAttachmentByUUID(uuidStr)
if err != nil {
log.Error("GetAttachmentByUUID failed:%v", err.Error())
return datasetDownload
}
dataset, err := models.GetDatasetByID(attachment.DatasetID)
if err != nil {
log.Error("GetDatasetByID failed:%v", err.Error())
return datasetDownload
}
repo, err := models.GetRepositoryByID(dataset.RepoID)
if err != nil {
log.Error("GetRepositoryByID failed:%v", err.Error())
return datasetDownload
}
url := ""
if isNeedDown {
url = attachment.S3DownloadURL()
if len(datasetnameList) <= i || len(datasetname) == 0 {
continue
}
name = datasetnameList[i]
isDelete = true
} else {
name = attachment.Name
dataset, err := models.GetDatasetByID(attachment.DatasetID)
if err != nil {
log.Error("GetDatasetByID failed:%v", err.Error())
} else {
repo, err := models.GetRepositoryByID(dataset.RepoID)
if err != nil {
log.Error("GetRepositoryByID failed:%v", err.Error())
} else {
link = repo.Link() + "/datasets"
}
}
if isNeedDown {
url = attachment.S3DownloadURL()
}
}

datasetDownload = append(datasetDownload, models.DatasetDownload{
DatasetName: attachment.Name,
DatasetName: name,
DatasetDownloadLink: url,
RepositoryLink: repo.Link() + "/datasets",
RepositoryLink: link,
IsDelete: isDelete,
})
}
log.Info("dataset length=" + fmt.Sprint(len(datasetDownload)))
return datasetDownload
}

@@ -898,14 +914,17 @@ func trainJobNewVersionDataPrepare(ctx *context.Context) error {
}
_, _, datasetNames, _, err := getDatasUrlListByUUIDS(task.Uuid)
if err != nil {
ctx.ServerError("GetAllUserAttachments failed:", err)
return err
log.Info("query dataset error," + err.Error())
//ctx.ServerError("GetAllUserAttachments failed:", err)
//return err
} else {
ctx.Data["dataset_name"] = datasetNames
}
ctx.Data["branches"] = branches
ctx.Data["branch_name"] = task.BranchName
ctx.Data["description"] = task.Description
ctx.Data["boot_file"] = task.BootFile
ctx.Data["dataset_name"] = datasetNames
ctx.Data["work_server_number"] = task.WorkServerNumber
ctx.Data["flavor_name"] = task.FlavorName
ctx.Data["engine_name"] = task.EngineName
@@ -1759,7 +1778,7 @@ func TrainJobShow(ctx *context.Context) {
} else {
VersionListTasks[i].Parameters = ""
}
datasetList = append(datasetList, GetCloudBrainDataSetInfo(task.Uuid, false))
datasetList = append(datasetList, GetCloudBrainDataSetInfo(task.Uuid, task.DatasetName, false))
VersionListTasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain)
VersionListTasks[i].CanModify = cloudbrain.CanModifyJob(ctx, &task.Cloudbrain)
}
@@ -2475,7 +2494,7 @@ func InferenceJobShow(ctx *context.Context) {
ctx.Data["displayJobName"] = task.DisplayJobName
ctx.Data["task"] = task
ctx.Data["canDownload"] = cloudbrain.CanModifyJob(ctx, task)
ctx.Data["datasetDownload"] = GetCloudBrainDataSetInfo(task.Uuid, false)
ctx.Data["datasetDownload"] = GetCloudBrainDataSetInfo(task.Uuid, task.DatasetName, false)
tempUids := []int64{}
tempUids = append(tempUids, task.UserID)
JobCreater, err := models.GetUserNamesByIDs(tempUids)


+ 1
- 1
templates/custom/wait_count_train.tmpl View File

@@ -18,7 +18,7 @@
></i>
<span id="gpu-nums" style="font-size: 12px"
>{{.ctx.i18n.Tr "repo.wait_count_start"}}
{{if .type}}
{{if .ctx.QueuesDetail}}
{{ $gpuQueue }}
{{else}}
{{.ctx.WaitCount}}


+ 7
- 1
templates/repo/cloudbrain/inference/show.tmpl View File

@@ -500,7 +500,13 @@
<tbody>
{{range $m ,$n := $.datasetDownload}}
<tr>
<td style="word-wrap: break-word;word-break: break-all;"><a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a></td>
<td style="word-wrap: break-word;word-break: break-all;">
{{if eq .IsDelete true}}
{{.DatasetName}}({{$.i18n.Tr "dataset.file_deleted"}})
{{else}}
<a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a>
{{end}}
</td>
</tr>
{{end}}


+ 7
- 1
templates/repo/cloudbrain/show.tmpl View File

@@ -498,7 +498,13 @@
<tbody>
{{range $m ,$n := $.datasetDownload}}
<tr>
<td style="word-wrap: break-word;word-break: break-all;"><a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a></td>
<td style="word-wrap: break-word;word-break: break-all;">
{{if eq .IsDelete true}}
{{.DatasetName}}({{$.i18n.Tr "dataset.file_deleted"}})
{{else}}
<a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a>
{{end}}
</td>
</tr>
{{end}}


+ 8
- 2
templates/repo/cloudbrain/trainjob/show.tmpl View File

@@ -464,7 +464,13 @@
<tbody>
{{range $m ,$n := $.datasetDownload}}
<tr>
<td style="word-wrap: break-word;word-break: break-all;"><a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a></td>
<td style="word-wrap: break-word;word-break: break-all;">
{{if eq .IsDelete true}}
{{.DatasetName}}({{$.i18n.Tr "dataset.file_deleted"}})
{{else}}
<a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a>
{{end}}
</td>
</tr>
{{end}}
@@ -594,7 +600,7 @@
<input type="hidden" name="trainTaskCreate" value="true">

<div class="required inline field">
<label>{{.i18n.Tr "repo.model.manage.createtrainjob"}}</label>
<label>{{.i18n.Tr "repo.modelarts.train_job"}}</label>
<input type="hidden" class="width83" id="JobId" name="JobId" readonly required>
<input type="hidden" id="VersionName" name="VersionName" value="V0001">
<input style="width: 45%;" id="JobName" readonly required>


+ 1
- 1
templates/repo/datasets/index.tmpl View File

@@ -417,7 +417,7 @@
<div class="bgtask-content">
<div class="bgtask-content-txt">{{.i18n.Tr "dataset.dataset_explain"}}</div>
<div class="bgtask-content-txt">{{.i18n.Tr "dataset.dataset_instructions_for_use"}}<a
href="https://git.openi.org.cn/zeizei/OpenI_Learning">{{.i18n.Tr "dataset.dataset_camp_course"}}</a></div>
href="https://git.openi.org.cn/zeizei/OpenI_Learning">&nbsp;{{.i18n.Tr "dataset.dataset_camp_course"}}</a></div>
</div>
</div>
</div>


+ 7
- 2
templates/repo/grampus/trainjob/show.tmpl View File

@@ -419,7 +419,12 @@
<td class="ti-text-form-content">
<div class="text-span text-span-w">
{{range $m ,$n := $.datasetDownload}}
<a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a>
{{if eq .IsDelete true}}
{{.DatasetName}}({{$.i18n.Tr "dataset.file_deleted"}})
{{else}}
<a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a>
{{end}}
{{end}}
</div>
</td>
@@ -551,7 +556,7 @@
<input type="hidden" name="trainTaskCreate" value="true">

<div class="required inline field">
<label>{{.i18n.Tr "repo.model.manage.createtrainjob"}}</label>
<label>{{.i18n.Tr "repo.modelarts.train_job"}}</label>
<input type="hidden" class="width83" id="JobId" name="JobId" readonly required>
<input type="hidden" id="VersionName" name="VersionName" value="V0001">
<input style="width: 45%;" id="JobName" readonly required>


+ 8
- 1
templates/repo/modelarts/inferencejob/show.tmpl View File

@@ -441,7 +441,14 @@ td, th {
<tbody>
{{range $m ,$n := $.datasetDownload}}
<tr>
<td style="word-wrap: break-word;word-break: break-all;"><a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a></td>
<td style="word-wrap: break-word;word-break: break-all;">
{{if eq .IsDelete true}}
{{.DatasetName}}({{$.i18n.Tr "dataset.file_deleted"}})
{{else}}
<a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a>
{{end}}
</td>
</tr>
{{end}}


+ 8
- 1
templates/repo/modelarts/notebook/show.tmpl View File

@@ -439,7 +439,14 @@
<tbody>
{{range $.datasetDownload}}
<tr>
<td style="word-wrap: break-word;word-break: break-all;"><a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a></td>
<td style="word-wrap: break-word;word-break: break-all;">
{{if eq .IsDelete true}}
{{.DatasetName}}({{$.i18n.Tr "dataset.file_deleted"}})
{{else}}
<a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a>
{{end}}
</td>
<td style="word-wrap: break-word;word-break: break-all;">{{.DatasetDownloadLink}}</td>
<td class="center aligned"><a class="ui poping up clipboard" id="clipboard-btn-dataset" data-original="{{$.i18n.Tr "repo.copy_link"}}" data-success="{{$.i18n.Tr "repo.copy_link_success"}}" data-error="{{$.i18n.Tr "repo.copy_link_error"}}" data-content="{{$.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-text="{{.DatasetDownloadLink}}">{{$.i18n.Tr "dataset.download_copy"}}</a></td>
</tr>


+ 8
- 2
templates/repo/modelarts/trainjob/show.tmpl View File

@@ -489,7 +489,13 @@
{{if eq $k $m}}
{{range $f ,$g := $n}}
<tr>
<td style="word-wrap: break-word;word-break: break-all;"><a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a></td>
<td style="word-wrap: break-word;word-break: break-all;">
{{if eq .IsDelete true}}
{{.DatasetName}}({{$.i18n.Tr "dataset.file_deleted"}})
{{else}}
<a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a>
{{end}}
</td>
</tr>
{{end}}
{{end}}
@@ -604,7 +610,7 @@

<div class="two inline fields ">
<div class="required ten wide field">
<label style="margin-left: -23px;">{{.i18n.Tr "repo.model.manage.createtrainjob"}}</label>
<label style="margin-left: -23px;">{{.i18n.Tr "repo.modelarts.train_job"}}</label>
<input type="hidden" class="width83" id="JobId" name="JobId" readonly required>
<input class="width83" id="JobName" readonly required>



+ 41
- 3
templates/repo/modelarts/trainjob/version_new.tmpl View File

@@ -73,12 +73,50 @@
<input type="hidden" id="ai_engine_name" name="engine_names" value="">
<input type="hidden" id="ai_flaver_name" name="flaver_names" value="">
<input type="hidden" id="display_job_name" name="display_job_name" value="{{.display_job_name}}">
{{template "custom/wait_count_train" Dict "ctx" $}}
<div style="display: flex;align-items: center;margin-left: 155px;margin-top: 0.5rem;">
<h4 class="unite title ui header ">{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}:</h4>
<div class="required min_title inline field">
<label class="" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_cluster"}}</label>
<div class="ui blue mini menu compact selectcloudbrain">
<a class="active item" href="javascript:void 0;" style="cursor:not-allowed;">
<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>
{{.i18n.Tr "cloudbrain.resource_cluster_openi"}}
</a>
<a class="item" href="javascript:void 0;" style="cursor:not-allowed;background:rgba(0,0,0,.03);">
<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>
{{.i18n.Tr "cloudbrain.resource_cluster_c2net"}}(Beta)
</a>
</div>
</div>
<div class="required inline min_title field">
<label class="" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.compute_resource"}}</label>
<div class="ui blue mini menu compact selectcloudbrain">
<a class="item" href="javascript:void 0;" style="cursor:not-allowed;background:rgba(0,0,0,.03);">
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16"
height="16">
<path fill="none" d="M0 0h24v24H0z" />
<path
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" />
</svg>
CPU/GPU
</a>
<a class="active item" href="javascript:void 0;" style="cursor:not-allowed;">
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16"
height="16">
<path fill="none" d="M0 0h24v24H0z" />
<path
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" />
</svg>
Ascend NPU</a>
</div>
</div>
<div style="margin-top:-5px;">
{{template "custom/wait_count_train" Dict "ctx" $}}
</div>
<div style="display: flex;align-items: center;margin-left: 155px;margin-top: 0.5rem;margin-bottom: 1.5rem;">
<i class="ri-error-warning-line" style="color: #f2711c;margin-right: 0.5rem;"></i>
<span style="color: #888;font-size: 12px;">{{.i18n.Tr "cloudbrain.train_dataset_path_rule" | Safe}}</span>
</div>
<h4 class="unite title ui header ">{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}:</h4>
<div class="required unite min_title inline field">
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>
<input type="hidden" style="width: 60%;" name="job_name" id="job_name" value="{{.job_name}}">


+ 2
- 2
templates/repo/modelmanage/convertIndex.tmpl View File

@@ -50,9 +50,9 @@
<div class="bgtask-content-header">{{$.i18n.Tr "repo.modelconvert.notcreate"}}</div>
<div class="bgtask-content">
{{if eq .MODEL_COUNT 0}}
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.modelconvert.importfirst1"}}<a href="{{.RepoLink}}/modelmanage/show_model">{{$.i18n.Tr "repo.modelconvert.importfirst2"}}</a>{{$.i18n.Tr "repo.modelconvert.importfirst3"}}</div>
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.modelconvert.importfirst1"}}<a href="{{.RepoLink}}/modelmanage/show_model">&nbsp;{{$.i18n.Tr "repo.modelconvert.importfirst2"}}&nbsp;</a>{{$.i18n.Tr "repo.modelconvert.importfirst3"}}</div>
{{end}}
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.platform_instructions"}}</div>
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.platform_instructions1"}}<a href="https://git.openi.org.cn/zeizei/OpenI_Learning">&nbsp;{{$.i18n.Tr "repo.platform_instructions2"}}&nbsp;</a>{{$.i18n.Tr "repo.platform_instructions3"}}</div>

</div>
</div>


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

@@ -71,9 +71,9 @@
{{end}}
{{if eq $.TRAIN_COUNT 0}}
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.model.manage.createtrainjob_tip"}}<a
href="{{.RepoLink}}/modelarts/train-job">{{$.i18n.Tr "repo.model.manage.createtrainjob"}}</a></div>
href="{{.RepoLink}}/modelarts/train-job">&nbsp;{{$.i18n.Tr "repo.model.manage.createtrainjob"}}</a></div>
{{end}}
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.platform_instructions"}}</a></div>
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.platform_instructions1"}}<a href="https://git.openi.org.cn/zeizei/OpenI_Learning">&nbsp;{{$.i18n.Tr "repo.platform_instructions2"}}&nbsp;</a>{{$.i18n.Tr "repo.platform_instructions3"}}</div>

</div>
<div style="display: none;">
@@ -330,7 +330,7 @@
.modal({
centered: false,
onShow: function () {
$('#model_header').text("导入新模型")
$('#model_header').text({{.i18n.Tr "repo.model.manage.import_new_model"}})
$('input[name="Version"]').addClass('model_disabled')
$('.ui.dimmer').css({ "background-color": "rgb(136, 136, 136,0.7)" })
$("#job-name").empty()


+ 1
- 1
templates/repo/modelmanage/showinfo.tmpl View File

@@ -125,7 +125,7 @@
</td>
</tr>
<tr>
<td class="ti-text-form-label text-width80">{{$.i18n.Tr "repo.model.manage.createtrainjob"}}</td>
<td class="ti-text-form-label text-width80">{{$.i18n.Tr "repo.modelarts.train_job"}}</td>
<td class="ti-text-form-content word-elipsis">
<a id="DisplayJobNameHref" class="title" style="font-size: 14px;" target="_blank">
<span id="DisplayJobName" class="fitted" style="width: 90%;vertical-align: middle;"></span>


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

@@ -197,11 +197,12 @@ export default {
this.getModelList()
},
showcreateVue(name,version,label){
let title= this.i18n.model_create_version_title;
$('.ui.modal.second')
.modal({
centered: false,
onShow:function(){
$('#model_header').text("创建模型新版本")
$('#model_header').text(title)
$('input[name="Name"]').addClass('model_disabled')
$('input[name="Name"]').attr('readonly','readonly')
$('input[name="modelSelectedFile"]').attr('readonly','readonly')


+ 1
- 1
web_src/js/components/dataset/referenceDataset.vue View File

@@ -248,7 +248,7 @@
>
<el-tabs v-model="activeName">
<el-tab-pane :label="i18n.public_dataset" name="first">
<el-row v-loading="loadingPublicPage">
<el-row v-loading="loadingPublicPage" style="min-height: 50px">
<el-checkbox-group
v-model="checkList"
style="font-size: 14px; line-height: 1"


+ 28
- 19
web_src/js/components/dataset/selectDataset.vue View File

@@ -11,9 +11,9 @@
v-if="benchmarkNew"
class="label-fix-width"
style="font-weight: normal"
>{{i18n.dataset_label}}</label
>{{ i18n.dataset_label }}</label
>
<label v-else>{{i18n.dataset_label}}</label>
<label v-else>{{ i18n.dataset_label }}</label>
<span
:class="
benchmarkNew === true ? 'dataset-train-span' : 'dataset-debug-span'
@@ -59,7 +59,7 @@
? 'select-dataset-button'
: 'select-dataset-button-color'
"
>{{i18n.dataset_select}}
>{{ i18n.dataset_select }}
</el-button>
<el-dialog
:title="i18n.dataset_select"
@@ -90,7 +90,11 @@
>
<el-tabs v-model="activeName" @tab-click="handleClick">
<!-- 当前项目的数据集 -->
<el-tab-pane :label="i18n.dataset_current_repo" name="first" v-loading="loadingCurrent">
<el-tab-pane
:label="i18n.dataset_current_repo"
name="first"
v-loading="loadingCurrent"
>
<el-row>
<el-tree
:data="currentDatasetList"
@@ -172,13 +176,13 @@
class="zip-loading"
v-if="data.DecompressState === 2"
>
{{i18n.dataset_unziping}}
{{ i18n.dataset_unziping }}
</span>
<span
class="unzip-failed"
v-if="data.DecompressState === 3"
>
{{i18n.dataset_unzip_failed}}
{{ i18n.dataset_unzip_failed }}
</span>
</span>
</span>
@@ -201,7 +205,11 @@
</div>
</el-tab-pane>
<!-- 我上传的数据集 -->
<el-tab-pane :label="i18n.dataset_my_upload" name="second" v-loading="loadingMy">
<el-tab-pane
:label="i18n.dataset_my_upload"
name="second"
v-loading="loadingMy"
>
<el-row>
<el-tree
:data="myDatasetList"
@@ -274,13 +282,13 @@
class="zip-loading"
v-if="data.DecompressState === 2"
>
{{i18n.dataset_unziping}}
{{ i18n.dataset_unziping }}
</span>
<span
class="unzip-failed"
v-if="data.DecompressState === 3"
>
{{i18n.dataset_unzip_failed}}
{{ i18n.dataset_unzip_failed }}
</span>
</span>
</span>
@@ -380,13 +388,13 @@
class="zip-loading"
v-if="data.DecompressState === 2"
>
{{i18n.dataset_unziping}}
{{ i18n.dataset_unziping }}
</span>
<span
class="unzip-failed"
v-if="data.DecompressState === 3"
>
{{i18n.dataset_unzip_failed}}
{{ i18n.dataset_unzip_failed }}
</span>
</span>
</span>
@@ -486,13 +494,13 @@
class="zip-loading"
v-if="data.DecompressState === 2"
>
{{i18n.dataset_unziping}}
{{ i18n.dataset_unziping }}
</span>
<span
class="unzip-failed"
v-if="data.DecompressState === 3"
>
{{i18n.dataset_unzip_failed}}
{{ i18n.dataset_unzip_failed }}
</span>
</span>
</span>
@@ -536,9 +544,9 @@
line-height: 40px;
"
>
{{i18n.dataset_selected}}
{{ i18n.dataset_selected }}
</div>
<div style="flex: 1; margin-top: 1.5rem">
<div style="flex: 1; margin: 1.5rem 0; overflow-y: auto">
<el-checkbox-group v-model="checkList">
<el-checkbox
v-for="(item, index) in selectDatasetArray"
@@ -558,7 +566,7 @@
color: #fff;
border: 1px solid #389e0d;
"
>{{i18n.dataset_ok}}</el-button
>{{ i18n.dataset_ok }}</el-button
>
</div>
</el-col>
@@ -732,7 +740,6 @@ export default {
.then((res) => {
this.loadingCurrent = false;
let data = JSON.parse(res.data.data);
console.log(data);
this.currentDatasetList = this.transformeTreeData(
data,
"currentTree",
@@ -978,7 +985,10 @@ export default {
let hasSelectDatasetName = $(".cloudbrain-type")
.data("dataset-name")
.split(";");
if (this.hasSelectDatasetList.length !== 0) {
if (
this.hasSelectDatasetList.length !== 0 &&
hasSelectDatasetName[0] !== ""
) {
this.saveStatusList = this.hasSelectDatasetList;
this.checkList = hasSelectDatasetName;
this.hasSelectDatasetList.forEach((item, index) => {
@@ -996,7 +1006,6 @@ export default {
location.href.indexOf("train-job") !== -1 ||
location.href.indexOf("inference") !== -1
) {
console.log("this.benchmarkNew");
this.benchmarkNew = true;
}
if (


+ 7
- 3
web_src/js/features/i18nVue.js View File

@@ -95,6 +95,8 @@ export const i18nVue = {
model_create_new_ver: "创建新版本",
model_download: "下载",
model_delete: "删除",
model_create_title: "导入新模型",
model_create_version_title: "创建模型新版本",
},
US: {
computer_vision: "computer vision",
@@ -148,11 +150,11 @@ export const i18nVue = {
downloads: "Downloads",
not_link_dataset: "No datasets have been linked yet",
no_link_dataset_tips1:
"You can display public datasets on the platform here by clicking the New Linked Dataset button.",
"You can display public datasets on the platform here by clicking the Linked Datasets button.",

dataset_instructions_for_use:
"Instructions for use: You can refer to Openi AI Collaboration Platform ",
dataset_camp_course: " Newcomer Training Camp Course",
"Instructions for use: You can refer to OpenI AI Collaboration Platform ",
dataset_camp_course: " OpenI_Learning",
dataset_link_success: "Linked dataset succeeded!",
dataset_link_failed: "Linked dataset Failed!",
dataset_over_nums: "Linked over ? datasets!",
@@ -196,5 +198,7 @@ export const i18nVue = {
model_create_new_ver: "New Version",
model_download: "Download",
model_delete: "Delete",
model_create_title: "Import new model",
model_create_version_title: "Create a new version of the model",
},
};

Loading…
Cancel
Save