diff --git a/models/dataset.go b/models/dataset.go index 726a5010f..b7186ac0b 100755 --- a/models/dataset.go +++ b/models/dataset.go @@ -107,6 +107,7 @@ type SearchDatasetOptions struct { Category string Task string License string + DatasetIDs []int64 ListOptions SearchOrderBy IsOwner bool @@ -177,6 +178,12 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond { } } + if len(opts.DatasetIDs) > 0 { + subCon := builder.NewCond() + subCon = subCon.And(builder.In("dataset.id", opts.DatasetIDs)) + cond = cond.Or(subCon) + } + return cond } @@ -447,3 +454,11 @@ func IncreaseDownloadCount(datasetID int64) error { return nil } + +func GetCollaboratorDatasetIdsByUserID(userID int64) []int64 { + var datasets []int64 + _ = x.Table("dataset").Join("INNER", "collaboration", "dataset.repo_id = collaboration.repo_id and collaboration.mode>0 and collaboration.user_id=?", userID). + Cols("dataset.id").Find(&datasets) + return datasets + +} diff --git a/modules/modelarts/resty.go b/modules/modelarts/resty.go index 961e02538..6a2803cb1 100755 --- a/modules/modelarts/resty.go +++ b/modules/modelarts/resty.go @@ -1131,7 +1131,7 @@ sendjob: res, err := client.R(). SetAuthToken(TOKEN). SetResult(&result). - Get(HOST + "/v1/" + setting.ProjectID + urlTrainJob + "/" + jobID + "/versions/" + versionID + "/pod/" + podName + "/metric-statistic") + Get(HOST + "/v1/" + setting.ProjectID + urlTrainJob + "/" + jobID + "/versions/" + versionID + "/pod/" + podName + "/metric-statistic?statistic_type=each") if err != nil { return nil, fmt.Errorf("resty GetTrainJobMetricStatistic: %v", err) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index cfc3786c8..a5d92af1b 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1092,6 +1092,7 @@ modelarts.train_job.fast_parameter_setting_config_link=fast_parameter_setting_co modelarts.train_job.frames=frames modelarts.train_job.algorithm_origin=Algorithm Origin modelarts.train_job.AI_driver=AI Engine +modelarts.train_job.AI_Engine=AI Engine modelarts.train_job.start_file=Start File modelarts.train_job.boot_file_helper=The startup file is the entry file that your program executes, and it must be a file ending in .py modelarts.train_job.dataset=Dataset diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index b84bca91c..02572f197 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -1102,6 +1102,7 @@ modelarts.train_job.fast_parameter_setting_config_link=这里 modelarts.train_job.frames=常用框架 modelarts.train_job.algorithm_origin=算法来源 modelarts.train_job.AI_driver=AI引擎 +modelarts.train_job.AI_Engine=模型框架 modelarts.train_job.start_file=启动文件 modelarts.train_job.boot_file_helper=启动文件是您程序执行的入口文件,必须是以.py结尾的文件。比如train.py、main.py、example/train.py、case/main.py。 modelarts.train_job.boot_file_place=填写启动文件路径,默认为train.py @@ -1197,7 +1198,7 @@ template.topics=主题 template.avatar=头像 template.issue_labels=任务标签 template.one_item=必须至少选择一个模板项 -template.one_promise=创建项目需承诺使用协议! +template.one_promise=创建项目时需承诺遵守使用协议 template.invalid=必须选择一个模板项目 template.repo_adress=项目地址 template.repo_path=项目地址 diff --git a/routers/home.go b/routers/home.go index e31bed4ff..ae184a72a 100755 --- a/routers/home.go +++ b/routers/home.go @@ -343,6 +343,12 @@ func ExploreDatasets(ctx *context.Context) { if ctx.User != nil && !ctx.User.IsAdmin { ownerID = ctx.User.ID } + var datasetsIds []int64 + if ownerID > 0 { + + datasetsIds = models.GetCollaboratorDatasetIdsByUserID(ownerID) + } + opts := &models.SearchDatasetOptions{ Keyword: keyword, IncludePublic: true, @@ -351,6 +357,7 @@ func ExploreDatasets(ctx *context.Context) { Task: task, License: license, OwnerID: ownerID, + DatasetIDs: datasetsIds, RecommendOnly: ctx.QueryBool("recommend"), ListOptions: models.ListOptions{ Page: page, diff --git a/routers/repo/dataset.go b/routers/repo/dataset.go index 9d7f4a4d7..05a89964f 100755 --- a/routers/repo/dataset.go +++ b/routers/repo/dataset.go @@ -173,7 +173,7 @@ func DatasetIndex(ctx *context.Context) { uploader, _ := models.GetUserByID(attachment.UploaderID) attachment.Uploader = uploader if !strings.HasSuffix(attachment.Name, ".zip") { - attachment.DecompressState = 3 //非zip文件 + attachment.DecompressState = -1 //非zip文件 } } diff --git a/templates/explore/datasets.tmpl b/templates/explore/datasets.tmpl index 7274ef64c..327c4fb98 100644 --- a/templates/explore/datasets.tmpl +++ b/templates/explore/datasets.tmpl @@ -157,8 +157,6 @@ href="{{$.Link}}?sort=moststars&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.moststars"}} {{.i18n.Tr "repo.issues.filter_sort.mostusecount"}} - {{.i18n.Tr "repo.issues.filter_sort.fewestusecount"}} @@ -201,7 +199,7 @@ {{else}} + style="display: flex;align-items: center;justify-content: flex-end;cursor: pointer;font-size: 12px;font-weight: normal;flex: 1;margin-left: 1.5rem;">
diff --git a/templates/repo/datasets/index.tmpl b/templates/repo/datasets/index.tmpl index 9a8f2aaea..22ee1f4c6 100755 --- a/templates/repo/datasets/index.tmpl +++ b/templates/repo/datasets/index.tmpl @@ -11,7 +11,7 @@ .dataset_title { font-size: 14px; - max-width: 80%; + /* max-width: 80%; */ display: inline-block !important; margin-left: 6px !important; padding-right: 0 !important; @@ -279,7 +279,7 @@
- {{if ne .DecompressState 3}}{{$.i18n.Tr "dataset.unzip_status"}}:{{if eq .DecompressState 1}}{{$.i18n.Tr "dataset.unzip_successed"}}{{else if eq .DecompressState 0}}{{$.i18n.Tr "dataset.unzip_stared"}}{{else}}{{$.i18n.Tr "dataset.unzip_failed"}}{{end}} + {{if ne .DecompressState -1}}{{$.i18n.Tr "dataset.unzip_status"}}:{{if eq .DecompressState 1}}{{$.i18n.Tr "dataset.unzip_successed"}}{{else if eq .DecompressState 0 2}}{{$.i18n.Tr "dataset.unzip_stared"}}{{else}}{{$.i18n.Tr "dataset.unzip_failed"}}{{end}}   {{end}}{{$.i18n.Tr "dataset.download"}}:{{.DownloadCount}} {{if .Description}}  {{$.i18n.Tr "dataset.description"}}:{{.Description}}{{end}} @@ -288,10 +288,10 @@ {{if eq .DecompressState 1}} - {{else if eq .DecompressState 0}} + {{else if eq .DecompressState 0 2}} - {{else if eq .DecompressState 2}} + {{else if eq .DecompressState 3}} {{else}} diff --git a/templates/repo/modelarts/trainjob/show.tmpl b/templates/repo/modelarts/trainjob/show.tmpl index 580940289..f22a2ce56 100755 --- a/templates/repo/modelarts/trainjob/show.tmpl +++ b/templates/repo/modelarts/trainjob/show.tmpl @@ -487,8 +487,8 @@
- - {{$.i18n.Tr "repo.modelarts.download_log"}} @@ -734,6 +734,12 @@ // detail status and duration $('#' + version_name + '-duration').text(data.JobDuration) $('#' + version_name + '-status').text(data.JobStatus) + console.log(data) + if (["KILLED", "FAILED", "START_FAILED", "STOPPED", "COMPLETED"].includes(data.JobStatus)) { + $(`#${version_name}-log-down`).removeClass('disabled').addClass('ti-download-file') + $('#' + version_name + '-stop').addClass('disabled') + } + loadLog(version_name) diff --git a/templates/repo/modelmanage/index.tmpl b/templates/repo/modelmanage/index.tmpl index 379bbec75..efd5162d5 100644 --- a/templates/repo/modelmanage/index.tmpl +++ b/templates/repo/modelmanage/index.tmpl @@ -1,5 +1,10 @@ {{template "base/head" .}} +
@@ -140,7 +145,7 @@