From a2ecaf7570b9eb32958b1975fb944ea888b37397 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Thu, 17 Mar 2022 12:33:34 +0800 Subject: [PATCH 01/12] #1627 update --- options/locale/locale_en-US.ini | 12 +++++++ options/locale/locale_zh-CN.ini | 13 ++++++++ templates/repo/cloudbrain/benchmark/index.tmpl | 40 ++++++++++++------------ templates/repo/debugjob/index.tmpl | 10 +++--- templates/repo/modelarts/inferencejob/index.tmpl | 34 ++++++++++---------- templates/repo/modelarts/trainjob/index.tmpl | 34 ++++++++++---------- 6 files changed, 84 insertions(+), 59 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index cb8fd7e15..a0acb05ec 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -984,6 +984,18 @@ modelarts.infer_job.model_version = Model/Version modelarts.infer_job.select_model = Select Model modelarts.infer_job.tooltip = The model has been deleted and cannot be viewed. + +debug_task_not_created = Debug task has not been created +train_task_not_created = Train task has not been created +inference_job_not_created = Inference job has not been created +model_Evaluation_not_created = Model evaluation has not been created +repo_not_initialized = Code version: You have not initialized the code repository, please initialized 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.Dataset also needs to be uploaded to the corresponding environment; +platform_instructions = Instructions for use: You can refer to the Xiaobai training camp course of Qizhi AI collaboration platform. +model_not_exist = Model file: You do not have a model file yet, please generate and export the model through the training task first ; +benchmark_leaderboards = Benchmark leaderboards + model.manage.import_new_model=Import New Model model.manage.create_error=Equal Name and Version has existed. model.manage.model_name = Model Name diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index b356e0d5b..fd5cde4d1 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -993,6 +993,18 @@ modelarts.infer_job.select_model = 选择模型 modelarts.infer_job.boot_file_helper=启动文件是您程序执行的入口文件,必须是以.py结尾的文件。比如inference.py、main.py、example/inference.py、case/main.py。 modelarts.infer_job.tooltip = 该模型已删除,无法查看。 + +debug_task_not_created = 未创建过调试任务 +train_task_not_created = 未创建过训练任务 +inference_job_not_created = 未创建过推理任务 +model_Evaluation_not_created = 未创建过评测任务 +repo_not_initialized = 代码版本:您还没有初始化代码仓库,请先创建代码版本; +debug_task_running_limit = 运行时长:最长不超过4个小时,超过4个小时将自动停止; +dataset_desc = 数据集:云脑1提供 CPU / GPU 资源,云脑2提供 Ascend NPU 资源,调试使用的数据集也需要上传到对应的环境; +platform_instructions = 使用说明:可以参考启智AI协作平台小白训练营课程。 +model_not_exist = 模型文件:您还没有模型文件,请先通过训练任务产生并 导出模型 ; +benchmark_leaderboards = 基准测试排行榜 + model.manage.import_new_model=导入新模型 model.manage.create_error=相同的名称和版本的模型已经存在。 model.manage.model_name = 模型名称 @@ -2825,3 +2837,4 @@ snn4imagenet_path = snn4imagenet脚本存放路径 brainscore_path = brainscore脚本存放路径 start_command = 启动命令 choose_mirror = 选择镜像或输入镜像地址 + diff --git a/templates/repo/cloudbrain/benchmark/index.tmpl b/templates/repo/cloudbrain/benchmark/index.tmpl index f66b94f20..902a04fac 100755 --- a/templates/repo/cloudbrain/benchmark/index.tmpl +++ b/templates/repo/cloudbrain/benchmark/index.tmpl @@ -39,8 +39,8 @@
- 基准测试排行榜 - {{if .Permission.CanWrite $.UnitTypeCloudBrain}} + {{$.i18n.Tr "repo.benchmark_leaderboards"}} + {{if .Permission.CanWrite $.UnitTypeCloudBrain}} {{$.i18n.Tr "repo.modelarts.evaluate_job.new_job"}} {{else}} {{$.i18n.Tr "repo.modelarts.evaluate_job.new_job"}} @@ -50,12 +50,12 @@ {{if eq 0 (len .Tasks)}}
-
未创建过评测任务
+
{{$.i18n.Tr "repo.model_Evaluation_not_created"}}
{{if $.RepoIsEmpty}} -
代码版本:您还没有初始化代码仓库,请先创建代码版本;
+
{{$.i18n.Tr "repo.repo_not_initialized" .RepoLink | Safe}}
{{end}} -
使用说明:可以参考启智AI协作平台小白训练营课程。
+
{{$.i18n.Tr "repo.platform_instructions" | Safe}}
{{else}} @@ -85,21 +85,21 @@ {{$.i18n.Tr "repo.cloudbrain_status_runtime"}}
- {{$.i18n.Tr "repo.modelarts.computing_resources"}} + {{$.i18n.Tr "repo.modelarts.computing_resources"}}
- {{$.i18n.Tr "repo.cloudbrain_creator"}} + {{$.i18n.Tr "repo.cloudbrain_creator"}}
{{$.i18n.Tr "repo.cloudbrain_operate"}}
- - + + {{range .Tasks}}
diff --git a/templates/repo/debugjob/index.tmpl b/templates/repo/debugjob/index.tmpl index ddc924df9..1b6f0ffc6 100755 --- a/templates/repo/debugjob/index.tmpl +++ b/templates/repo/debugjob/index.tmpl @@ -242,14 +242,14 @@ {{if eq 0 (len .Tasks)}}
-
未创建过调试任务
+
{{$.i18n.Tr "repo.debug_task_not_created"}}
{{if $.RepoIsEmpty}} -
代码版本:您还没有初始化代码仓库,请先创建代码版本
+
{{$.i18n.Tr "repo.repo_not_initialized" .RepoLink | Safe}}
{{end}} -
运行时长:最长不超过4个小时,超过4个小时将自动停止;
-
数据集:云脑1提供 CPU / GPU 资源,云脑2提供 Ascend NPU 资源,调试使用的数据集也需要上传到对应的环境;
-
使用说明:可以参考启智AI协作平台小白训练营课程。
+
{{$.i18n.Tr "repo.debug_task_running_limit"}}
+
{{$.i18n.Tr "repo.dataset_desc"}}
+
{{$.i18n.Tr "repo.platform_instructions" | Safe}}
{{else}} diff --git a/templates/repo/modelarts/inferencejob/index.tmpl b/templates/repo/modelarts/inferencejob/index.tmpl index 68ba3c831..5e2ecd730 100644 --- a/templates/repo/modelarts/inferencejob/index.tmpl +++ b/templates/repo/modelarts/inferencejob/index.tmpl @@ -39,7 +39,7 @@
- {{if .Permission.CanWrite $.UnitTypeCloudBrain}} + {{if .Permission.CanWrite $.UnitTypeCloudBrain}} {{$.i18n.Tr "repo.modelarts.train_job.new_infer"}} {{else}} {{$.i18n.Tr "repo.modelarts.train_job.new_infer"}} @@ -49,16 +49,16 @@ {{if eq 0 (len .Tasks)}}
-
未创建过推理任务
+
{{$.i18n.Tr "repo.inference_job_not_created"}}
{{if $.RepoIsEmpty}} -
代码版本:您还没有初始化代码仓库,请先创建代码版本;
+
{{$.i18n.Tr "repo.repo_not_initialized" .RepoLink | Safe}}
{{end}} {{if eq 0 $.MODEL_COUNT}} -
模型文件:您还没有模型文件,请先通过训练任务产生并 导出模型
+
{{$.i18n.Tr "repo.model_not_exist" .RepoLink .RepoLink | Safe}}
{{end}} -
数据集:云脑1提供 CPU / GPU 资源,云脑2提供 Ascend NPU 资源,调试使用的数据集也需要上传到对应的环境;
-
使用说明:可以参考启智AI协作平台小白训练营课程。
+
{{$.i18n.Tr "repo.dataset_desc"}}
+
{{$.i18n.Tr "repo.platform_instructions" | Safe}}
{{else}} @@ -88,32 +88,32 @@ {{$.i18n.Tr "repo.cloudbrain_status_runtime"}}
- {{$.i18n.Tr "repo.cloudbrain_creator"}} + {{$.i18n.Tr "repo.cloudbrain_creator"}}
{{$.i18n.Tr "repo.cloudbrain_operate"}}
- - + + {{range .Tasks}}
- + -
- {{.ModelName}}  {{.ModelVersion}} +
+ {{.ModelName}}  {{.ModelVersion}}
@@ -126,12 +126,12 @@ {{TimeSinceUnix .Cloudbrain.CreatedUnix $.Lang}}
-
- {{.TrainJobDuration}} +
+ {{.TrainJobDuration}}
diff --git a/templates/repo/modelarts/trainjob/index.tmpl b/templates/repo/modelarts/trainjob/index.tmpl index ed94c0598..db077bebc 100755 --- a/templates/repo/modelarts/trainjob/index.tmpl +++ b/templates/repo/modelarts/trainjob/index.tmpl @@ -39,7 +39,7 @@
- {{if .Permission.CanWrite $.UnitTypeCloudBrain}} + {{if .Permission.CanWrite $.UnitTypeCloudBrain}} {{$.i18n.Tr "repo.modelarts.train_job.new_train"}} {{else}} {{$.i18n.Tr "repo.modelarts.train_job.new_train"}} @@ -49,13 +49,13 @@ {{if eq 0 (len .Tasks)}}
-
未创建过训练任务
+
{{$.i18n.Tr "repo.train_task_not_created"}}
{{if $.RepoIsEmpty}} -
代码版本:您还没有初始化代码仓库,请先创建代码版本;
+
{{$.i18n.Tr "repo.repo_not_initialized" .RepoLink | Safe}}
{{end}} -
数据集:云脑1提供 CPU / GPU 资源,云脑2提供 Ascend NPU 资源,调试使用的数据集也需要上传到对应的环境;
-
使用说明:可以参考启智AI协作平台小白训练营课程。
+
{{$.i18n.Tr "repo.dataset_desc"}}
+
{{$.i18n.Tr "repo.platform_instructions" | Safe}}
{{else}} @@ -85,31 +85,31 @@ {{$.i18n.Tr "repo.cloudbrain_status_runtime"}}
- {{$.i18n.Tr "repo.modelarts.computing_resources"}} + {{$.i18n.Tr "repo.modelarts.computing_resources"}}
- {{$.i18n.Tr "repo.cloudbrain_creator"}} + {{$.i18n.Tr "repo.cloudbrain_creator"}}
{{$.i18n.Tr "repo.cloudbrain_operate"}}
-
-
+
+ {{range .Tasks}}
- + -
- {{.VersionCount}} +
+ {{.VersionCount}}
@@ -122,12 +122,12 @@ {{TimeSinceUnix .Cloudbrain.CreatedUnix $.Lang}}
-
- {{.TrainJobDuration}} +
+ {{.TrainJobDuration}}
- {{.ComputeResource}} + {{.ComputeResource}}
@@ -205,4 +205,4 @@
-{{template "base/footer" .}} \ No newline at end of file +{{template "base/footer" .}} From edf4ff3815ed931a36469daea3e89a9b8babc7fc Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Fri, 18 Mar 2022 19:22:53 +0800 Subject: [PATCH 02/12] #1627 update --- options/locale/locale_en-US.ini | 30 ++++- options/locale/locale_zh-CN.ini | 24 ++++ templates/admin/cloudbrain/list.tmpl | 46 ++++---- templates/explore/repo_left.tmpl | 28 ++--- templates/explore/repo_list.tmpl | 4 +- templates/repo/cloudbrain/benchmark/index.tmpl | 8 +- templates/repo/cloudbrain/benchmark/new.tmpl | 30 ++--- templates/repo/cloudbrain/benchmark/show.tmpl | 86 +++++++-------- templates/repo/cloudbrain/new.tmpl | 4 +- templates/repo/debugjob/index.tmpl | 8 +- templates/repo/modelarts/inferencejob/index.tmpl | 8 +- templates/repo/modelarts/inferencejob/new.tmpl | 46 ++++---- templates/repo/modelarts/inferencejob/show.tmpl | 118 ++++++++++---------- templates/repo/modelarts/trainjob/index.tmpl | 8 +- templates/repo/modelarts/trainjob/new.tmpl | 42 +++---- templates/repo/modelarts/trainjob/para_manage.tmpl | 30 ++--- templates/repo/modelarts/trainjob/show.tmpl | 122 ++++++++++----------- templates/repo/modelarts/trainjob/version_new.tmpl | 42 +++---- templates/repo/modelmanage/index.tmpl | 22 ++-- 19 files changed, 378 insertions(+), 328 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index a0acb05ec..aba6bfbf3 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -273,6 +273,20 @@ code_search_results = Search results for '%s' code_last_indexed_at = Last indexed %s save=Save cancel=Cancel +hot_repo=Hot Repositories +active_repo=Active Repositories +all_fields = All fields +large_model = Large model +ai_development_tools = AI tools +computer_version = Computer version +natural_language_processing = NLP +machine_learning = Machine learning +neural_networks = Neural networks +autopilot = Autopilot +robot = Robot +federated_learning = Federated learning +data_mining = Data mining +RISC-V_development = RISC-V development [auth] create_new_account = Register Account @@ -982,6 +996,7 @@ modelarts.infer_job_model_file = Model File modelarts.infer_job = Inference Job modelarts.infer_job.model_version = Model/Version modelarts.infer_job.select_model = Select Model +modelarts.infer_job.boot_file_helper=The startup file is the entry file for your program execution and must end in.py.Such as inference.py, main.py, example/inference. Py, case/main.py. modelarts.infer_job.tooltip = The model has been deleted and cannot be viewed. @@ -991,7 +1006,7 @@ inference_job_not_created = Inference job has not been created model_Evaluation_not_created = Model evaluation has not been created repo_not_initialized = Code version: You have not initialized the code repository, please initialized 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.Dataset also needs to be uploaded to the corresponding environment; +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 Xiaobai training camp course of Qizhi AI collaboration platform. model_not_exist = Model file: You do not have a model file yet, please generate and export the model through the training task first ; benchmark_leaderboards = Benchmark leaderboards @@ -2828,4 +2843,15 @@ benchmark_path = Benchmark script path snn4imagenet_path = Snn4imagenet script path brainscore_path = Brainscore script path start_command = Start command -choose_mirror = select mirror +choose_mirror = select mirror or enter mirror path + +job_name_rule = Please enter letters, numbers, _ and - up to 64 characters and cannot end with a dash (-). +dataset_path_rule = The dataset location is stored in the environment variable data_url, and the training output path is stored in the environment variable train_url. +view_sample = View sample +inference_output_path_rule = The inference output path is stored in the environment variable result_url. +model_file_path_rule=The model file location is stored in the environment variable ckpt_url + +delete_task = Delete task +task_delete_confirm = Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered. +operate_confirm = confirm +operate_cancel = cancel diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index fd5cde4d1..5a86801d0 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -275,6 +275,20 @@ code_search_results=“%s” 的搜索结果是 code_last_indexed_at=最后索引于 %s save=保存 cancel=取消 +hot_repo=热门项目 +active_repo=活跃项目 +all_fields = 全部领域 +large_model = 大模型 +ai_development_tools = AI开发工具 +computer_version = 计算机视觉 +natural_language_processing = 自然语言处理 +machine_learning = 机器学习 +neural_networks = 神经网络 +autopilot = 自动驾驶 +robot = 机器人 +federated_learning = 联邦学习 +data_mining = 数据挖掘 +RISC-V_development = RISC-V开发 [auth] create_new_account=注册帐号 @@ -2838,3 +2852,13 @@ brainscore_path = brainscore脚本存放路径 start_command = 启动命令 choose_mirror = 选择镜像或输入镜像地址 +job_name_rule = 请输入字母、数字、_和-,最长64个字符,且不能以中划线(-)结尾。 +dataset_path_rule = 数据集位置存储在环境变量data_url中,训练输出路径存储在环境变量train_url中。 +view_sample = 查看样例 +inference_output_path_rule = 推理输出路径存储在环境变量result_url中。 +model_file_path_rule = 模型文件位置存储在环境变量ckpt_url中。 + +delete_task = 删除任务 +task_delete_confirm = 你确认删除该任务么?此任务一旦删除不可恢复。 +operate_confirm = 确定操作 +operate_cancel = 取消操作 diff --git a/templates/admin/cloudbrain/list.tmpl b/templates/admin/cloudbrain/list.tmpl index 9aac97e70..39b2c21de 100644 --- a/templates/admin/cloudbrain/list.tmpl +++ b/templates/admin/cloudbrain/list.tmpl @@ -43,26 +43,26 @@ {{$.i18n.Tr "repo.cloudbrain_status_runtime"}}
- {{$.i18n.Tr "repo.modelarts.computing_resources"}} + {{$.i18n.Tr "repo.modelarts.computing_resources"}}
- {{$.i18n.Tr "repo.cloudbrain_creator"}} + {{$.i18n.Tr "repo.cloudbrain_creator"}}
- {{$.i18n.Tr "repository"}} + {{$.i18n.Tr "repository"}}
- {{.i18n.Tr "admin.cloudbrain.cloudbrain_name"}} + {{.i18n.Tr "admin.cloudbrain.cloudbrain_name"}}
{{$.i18n.Tr "repo.cloudbrain_operate"}}
-
- + + {{range .Tasks}} {{if .Repo}}
-
+
{{$JobID := '0'}} {{if eq .JobType "DEBUG" "SNN4IMAGENET" "BRAINSCORE" "BENCHMARK"}} @@ -91,8 +91,8 @@ {{end}}
-
- {{.JobType}} +
+ {{.JobType}}
@@ -105,12 +105,12 @@ {{TimeSinceUnix1 .Cloudbrain.CreatedUnix}}
-
- {{if .TrainJobDuration}}{{.TrainJobDuration}}{{else}}--{{end}} +
+ {{if .TrainJobDuration}}{{.TrainJobDuration}}{{else}}--{{end}}
- {{if .ComputeResource}}{{.ComputeResource}}{{else}}--{{end}} + {{if .ComputeResource}}{{.ComputeResource}}{{else}}--{{end}}
@@ -178,7 +178,7 @@ {{$JobID = .JobID}} {{end}}
-
+
{{if eq .JobType "DEBUG"}} @@ -200,8 +200,8 @@ {{end}}
-
- {{.JobType}} +
+ {{.JobType}}
@@ -214,12 +214,12 @@ {{TimeSinceUnix1 .Cloudbrain.CreatedUnix}}
-
- {{if .TrainJobDuration}}{{.TrainJobDuration}}{{else}}--{{end}} +
+ {{if .TrainJobDuration}}{{.TrainJobDuration}}{{else}}--{{end}}
- {{if .ComputeResource}}{{.ComputeResource}}{{else}}--{{end}} + {{if .ComputeResource}}{{.ComputeResource}}{{else}}--{{end}}
@@ -296,18 +296,18 @@
diff --git a/templates/explore/repo_left.tmpl b/templates/explore/repo_left.tmpl index ca6a3b3dd..66c46e1ba 100755 --- a/templates/explore/repo_left.tmpl +++ b/templates/explore/repo_left.tmpl @@ -4,73 +4,73 @@ - 全部领域 + {{.i18n.Tr "explore.all_fields"}} - 大模型 + {{.i18n.Tr "explore.large_model"}} - AI开发工具 + {{.i18n.Tr "explore.ai_development_tools"}} - 计算机视觉 + {{.i18n.Tr "explore.computer_version"}} - 自然语言处理 + {{.i18n.Tr "explore.natural_language_processing"}} - 机器学习 + {{.i18n.Tr "explore.machine_learning"}} - 神经网络 + {{.i18n.Tr "explore.neural_networks"}} - 自动驾驶 + {{.i18n.Tr "explore.autopilot"}} - 机器人 + {{.i18n.Tr "explore.robot"}} - 联邦学习 + {{.i18n.Tr "explore.federated_learning"}} - 数据挖掘 + {{.i18n.Tr "explore.data_mining"}} - RISC-V开发 - + {{.i18n.Tr "explore.RISC-V_development"}} +
-
\ No newline at end of file +
diff --git a/templates/explore/repo_list.tmpl b/templates/explore/repo_list.tmpl index 0e01186b0..b6bb49da9 100755 --- a/templates/explore/repo_list.tmpl +++ b/templates/explore/repo_list.tmpl @@ -44,13 +44,13 @@ - 热门{{.i18n.Tr "explore.repos"}} + {{.i18n.Tr "explore.hot_repo"}} - 活跃{{.i18n.Tr "explore.repos"}} + {{.i18n.Tr "explore.active_repo"}} {{end}} diff --git a/templates/repo/cloudbrain/benchmark/index.tmpl b/templates/repo/cloudbrain/benchmark/index.tmpl index 902a04fac..a816a3e2b 100755 --- a/templates/repo/cloudbrain/benchmark/index.tmpl +++ b/templates/repo/cloudbrain/benchmark/index.tmpl @@ -204,18 +204,18 @@
@@ -217,7 +217,7 @@ setChildType(); } } - + function validate(){ $('.ui.form') .form({ @@ -239,7 +239,7 @@ // $('.ui.page.dimmer').dimmer('show') document.getElementById("mask").style.display = "block" }, - onFailure: function(e){ + onFailure: function(e){ return false; } }) @@ -247,6 +247,6 @@ $('.ui.create_train_job.green.button').click(function(e) { - validate() + validate() }) - \ No newline at end of file + diff --git a/templates/repo/cloudbrain/benchmark/show.tmpl b/templates/repo/cloudbrain/benchmark/show.tmpl index a6c529597..3c8f91528 100755 --- a/templates/repo/cloudbrain/benchmark/show.tmpl +++ b/templates/repo/cloudbrain/benchmark/show.tmpl @@ -82,7 +82,7 @@ vertical-align: inherit; } .ti-text-form-label { - + padding-bottom: 20px; padding-right: 20px; color: #8a8e99; @@ -152,7 +152,7 @@ td, th { opacity: .45 !important; } .pad20{ - + border:0px !important; } .model_file_bread{ @@ -196,14 +196,14 @@ td, th {
- {{TimeSinceUnix1 .CreatedUnix}} - + {{TimeSinceUnix1 .CreatedUnix}} + {{$.i18n.Tr "repo.modelarts.status"}}: {{.Status}} {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}: {{$.duration}} - +
@@ -244,12 +244,12 @@ td, th {
- + - {{$.i18n.Tr "repo.modelarts.train_job.start_time"}} + {{$.i18n.Tr "repo.modelarts.train_job.start_time"}} - +
{{TimeSinceUnix1 .CreatedUnix}} @@ -258,9 +258,9 @@ td, th { - {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}} + {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}} - +
{{$.duration}} @@ -269,9 +269,9 @@ td, th { - 镜像 + 镜像 - +
{{.Image}} @@ -280,30 +280,30 @@ td, th { - 类型 + 类型 - +
{{$.BenchmarkTypeName}}
- - + +
- - + + - + - + - + - + - + - + - + - + --> - + - + - + - + - + - + - + - + - + - + - + - + - + " html += "" html += "" - + } html += "" html += "
训练程序
train.py @@ -314,19 +314,19 @@ td, th {
测试程序
test.py
- {{$.i18n.Tr "repo.modelarts.train_job.description"}} + {{$.i18n.Tr "repo.modelarts.train_job.description"}}
{{.Description}} @@ -336,9 +336,9 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.train_job.standard"}} + {{$.i18n.Tr "repo.modelarts.train_job.standard"}}
{{$.resource_spec}} @@ -348,9 +348,9 @@ td, th {
- 创建者 + 创建者
{{.User.Name}} @@ -359,9 +359,9 @@ td, th {
- 子类型 + 子类型
{{$.BenchmarkChildTypeName}} @@ -373,7 +373,7 @@ td, th {
- +
@@ -386,11 +386,11 @@ td, th {

                             
- + - + - + @@ -400,24 +400,24 @@ td, th {
- - + + {{template "base/footer" .}} @@ -430,7 +430,7 @@ td, th { $(document).ready(function(){ $('.secondary.menu .item').tab(); }); - + let userName let repoPath let jobName @@ -454,5 +454,5 @@ td, th { document.getElementById("mask").style.display = "none" }); } - - \ No newline at end of file + + diff --git a/templates/repo/cloudbrain/new.tmpl b/templates/repo/cloudbrain/new.tmpl index 6b5388b5a..53ec56f8a 100755 --- a/templates/repo/cloudbrain/new.tmpl +++ b/templates/repo/cloudbrain/new.tmpl @@ -147,12 +147,12 @@
- +
- {{if .is_snn4imagenet_enabled}} diff --git a/templates/repo/debugjob/index.tmpl b/templates/repo/debugjob/index.tmpl index 1b6f0ffc6..ab6e266af 100755 --- a/templates/repo/debugjob/index.tmpl +++ b/templates/repo/debugjob/index.tmpl @@ -458,18 +458,18 @@
diff --git a/templates/repo/modelarts/inferencejob/index.tmpl b/templates/repo/modelarts/inferencejob/index.tmpl index 5e2ecd730..b9724d3d8 100644 --- a/templates/repo/modelarts/inferencejob/index.tmpl +++ b/templates/repo/modelarts/inferencejob/index.tmpl @@ -205,18 +205,18 @@
diff --git a/templates/repo/modelarts/inferencejob/new.tmpl b/templates/repo/modelarts/inferencejob/new.tmpl index 5bb7aee6d..6f174bbbb 100644 --- a/templates/repo/modelarts/inferencejob/new.tmpl +++ b/templates/repo/modelarts/inferencejob/new.tmpl @@ -68,9 +68,9 @@
- 请输入字母、数字、_和-,最长64个字符,且不能以中划线(-)结尾。 + {{.i18n.Tr "cloudbrain.job_name_rule"}}
- +
   @@ -107,7 +107,7 @@ - +
@@ -123,10 +123,10 @@
- +
- +
@@ -181,7 +181,7 @@ {{end}} - + @@ -195,9 +195,9 @@ - 查看样例 + {{.i18n.Tr "cloudbrain.view_sample"}} - +
   @@ -222,7 +222,7 @@ {{end}}
- + - 推理输出路径存储在环境变量result_url中。 + {{.i18n.Tr "cloudbrain.inference_output_path_rule"}}
@@ -255,7 +255,7 @@ {{.i18n.Tr "repo.cloudbrain.new"}} {{.i18n.Tr "repo.cloudbrain.cancel"}} -
+ @@ -283,7 +283,7 @@ $("#select_model").dropdown('set text',nameList[0]) $("#select_model").dropdown('set value',nameList[0],nameList[0]) } - + $('#select_model').removeClass("loading") }) // 根据选中的模型名称获取相应的模型版本 @@ -323,7 +323,7 @@ if(!element.IsDir && loadCheckpointFile.includes(ckptSuffix[ckptSuffix.length-1])){ html += `
${element.FileName}
` } - + }) $('#model_checkpoint').append(html) $("#select_model_checkpoint").removeClass("loading") @@ -332,7 +332,7 @@ $("#select_model_checkpoint").dropdown('set text',initVersionText) $("#select_model_checkpoint").dropdown('set value',initVersionValue,initVersionText,$('#model_name_version div.item:first-child')) }) - + $("input#ai_model_version").val(text) $("input#ai_model_label").val(label) @@ -348,15 +348,15 @@ } $('.question.circle.icon').hover(function(){ - $(this).popup('show') + $(this).popup('show') }); // 参数增加、删除、修改、保存 function Add_parameter(i){ value = '
' + - '
' + - ' ' + - '
' + + '
' + + ' ' + + '
' + '
' + '' + '
'+ @@ -366,7 +366,7 @@ '' + '
' $(".dynamic.field").append(value) - } + } $('#add_run_para').click(function(){ var len = $(".dynamic.field .two.fields").length @@ -459,7 +459,7 @@ onSuccess: function(){ document.getElementById("mask").style.display = "block" }, - onFailure: function(e){ + onFailure: function(e){ return false; } }) @@ -470,8 +470,8 @@ } } $('.ui.create_train_job.green.button').click(function(e) { - send_run_para() + send_run_para() get_name() validate() }) - \ No newline at end of file + diff --git a/templates/repo/modelarts/inferencejob/show.tmpl b/templates/repo/modelarts/inferencejob/show.tmpl index 4e221acd4..e11919b71 100644 --- a/templates/repo/modelarts/inferencejob/show.tmpl +++ b/templates/repo/modelarts/inferencejob/show.tmpl @@ -82,7 +82,7 @@ vertical-align: inherit; } .ti-text-form-label { - + padding-bottom: 20px; padding-right: 20px; color: #8a8e99; @@ -152,7 +152,7 @@ td, th { opacity: .45 !important; } .pad20{ - + border:0px !important; } .model_file_bread{ @@ -180,12 +180,12 @@ td, th { {{with .task}}
{{$.i18n.Tr "repo.modelarts.run_version"}}
{{.VersionName}} @@ -227,9 +227,9 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.train_job.start_time"}} + {{$.i18n.Tr "repo.modelarts.train_job.start_time"}}
{{TimeSinceUnix1 .CreatedUnix}} @@ -238,9 +238,9 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}} + {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}
{{.TrainJobDuration}} @@ -248,23 +248,23 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.train_job.AI_driver"}} + {{$.i18n.Tr "repo.modelarts.train_job.AI_driver"}}
{{.EngineName}}
{{$.i18n.Tr "repo.model.manage.description"}}
{{if .Description}} @@ -279,7 +279,7 @@ td, th {
创建人
{{$.userName}} @@ -288,7 +288,7 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.train_job.compute_node"}} + {{$.i18n.Tr "repo.modelarts.train_job.compute_node"}}
@@ -304,19 +304,19 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.infer_job_model"}} + {{$.i18n.Tr "repo.modelarts.infer_job_model"}}
{{.ModelName}}   {{$.i18n.Tr "repo.modelarts.version"}}:{{.ModelVersion}}   - +
- {{$.i18n.Tr "repo.modelarts.infer_job_model_file"}} + {{$.i18n.Tr "repo.modelarts.infer_job_model_file"}}
@@ -328,10 +328,10 @@ td, th {
{{$.i18n.Tr "repo.modelarts.model_label"}}
- + {{if .LabelName}} {{range $.labelName}} {{.}} @@ -342,7 +342,7 @@ td, th {
{{$.i18n.Tr "repo.modelarts.code_version"}} @@ -358,7 +358,7 @@ td, th { {{$.i18n.Tr "repo.modelarts.train_job.start_file"}}
{{.BootFile}} @@ -367,9 +367,9 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.infer_dataset"}} + {{$.i18n.Tr "repo.modelarts.infer_dataset"}}
{{.DatasetName}} @@ -378,9 +378,9 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.train_job.run_parameter"}} + {{$.i18n.Tr "repo.modelarts.train_job.run_parameter"}}
{{if .Parameters}} @@ -393,9 +393,9 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.train_job.standard"}} + {{$.i18n.Tr "repo.modelarts.train_job.standard"}}
{{.FlavorName}} @@ -407,10 +407,10 @@ td, th {
- + - +
- +
- +
@@ -434,34 +434,34 @@ td, th {
- +
- + {{end}} - - - - - + + + + +
@@ -493,7 +493,7 @@ function loadLog(version_name){ }); } function logScroll(version_name) { - + let container = document.querySelector(`#log${version_name}`) let scrollTop = container.scrollTop let scrollHeight = container.scrollHeight @@ -506,7 +506,7 @@ function logScroll(version_name) { $(`.message${version_name} #header`).text('您已翻阅至日志底部') $(`.message${version_name}`).css('display', 'block') setTimeout(function(){ - $(`.message${version_name}`).css('display', 'none') + $(`.message${version_name}`).css('display', 'none') }, 1000) }else{ if(end_line===data.EndLine){ @@ -514,9 +514,9 @@ function logScroll(version_name) { } else{ $(`#log${version_name} input[name=end_line]`).val(data.EndLine) - $(`#log${version_name}`).append('
' + data.Content) 
+                    $(`#log${version_name}`).append('
' + data.Content)
                 }
-                
+
             }
         }).fail(function(err) {
             console.log(err);
@@ -529,7 +529,7 @@ function logScroll(version_name) {
                 $(`.message${version_name} #header`).text('您已翻阅至日志顶部')
                 $(`.message${version_name}`).css('display', 'block')
                 setTimeout(function(){
-                    $(`.message${version_name}`).css('display', 'none')     
+                    $(`.message${version_name}`).css('display', 'none')
                 }, 1000)
             }else{
                 $(`#log${version_name} input[name=start_line]`).val(data.StartLine)   //如果变动就改变所对应的值
@@ -557,7 +557,7 @@ function loadModelFile(version_name,parents,filename,init){
     filename = filename || ''
     init = init || ''
     $.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/inference-job/${jobID}/result_list?version_name=${version_name}&parentDir=${parents}`, (data) => {
-            $(`#dir_list${version_name}`).empty() 
+            $(`#dir_list${version_name}`).empty()
             renderDir(data,version_name)
             if(init==="init"){
                 $(`input[name=model${version_name}]`).val("")
@@ -565,7 +565,7 @@ function loadModelFile(version_name,parents,filename,init){
                 $(`#file_breadcrumb${version_name}`).empty()
                 let htmlBread = ""
                 htmlBread += `
result
` - htmlBread += "
/
" + htmlBread += "
/
" $(`#file_breadcrumb${version_name}`).append(htmlBread) }else{ renderBrend(version_name,parents,filename,init) @@ -573,7 +573,7 @@ function loadModelFile(version_name,parents,filename,init){ }).fail(function(err) { console.log(err,version_name); }); - + } function renderBrend(version_name,parents,filename,init){ if(init=="folder"){ @@ -586,9 +586,9 @@ function renderBrend(version_name,parents,filename,init){ }else{ $(`#file_breadcrumb${version_name} .active.section`).replaceWith(`${sectionName}`) } - + htmlBrend += `
${filename}
` - htmlBrend += "
/
" + htmlBrend += "
/
" $(`#file_breadcrumb${version_name}`).append(htmlBrend) $(`input[name=model${version_name}]`).val(parents) $(`input[name=modelback${version_name}]`).val(filename) @@ -599,7 +599,7 @@ function renderBrend(version_name,parents,filename,init){ $(`#file_breadcrumb${version_name} a.section:contains(${filename})`).replaceWith(`
${filename}
`) $(`#file_breadcrumb${version_name} div.section:contains(${filename})`).append("
/
") } - + } function renderDir(data,version_name){ let html="" @@ -638,14 +638,14 @@ function renderDir(data,version_name){ }else{ html += ""+ `${dirs_size}` + "" } - + html += "
" html += "" + data.Dirs[i].ModTime + "" html += "
" @@ -655,4 +655,4 @@ function renderDir(data,version_name){ html += "
" $(`#dir_list${version_name}`).append(html) } - \ No newline at end of file + diff --git a/templates/repo/modelarts/trainjob/index.tmpl b/templates/repo/modelarts/trainjob/index.tmpl index db077bebc..19c6b3841 100755 --- a/templates/repo/modelarts/trainjob/index.tmpl +++ b/templates/repo/modelarts/trainjob/index.tmpl @@ -188,18 +188,18 @@
diff --git a/templates/repo/modelarts/trainjob/new.tmpl b/templates/repo/modelarts/trainjob/new.tmpl index 0854f487c..6ec48bc7d 100755 --- a/templates/repo/modelarts/trainjob/new.tmpl +++ b/templates/repo/modelarts/trainjob/new.tmpl @@ -81,9 +81,9 @@
- 请输入字母、数字、_和-,最长64个字符,且不能以中划线(-)结尾。 + {{.i18n.Tr "cloudbrain.job_name_rule"}}
- +
@@ -91,7 +91,7 @@

{{.i18n.Tr "repo.modelarts.train_job.parameter_setting"}}:

- +
@@ -147,7 +147,7 @@ - 查看样例 + {{.i18n.Tr "cloudbrain.view_sample"}}
@@ -160,9 +160,9 @@ {{end}} - 数据集位置存储在环境变量data_url中,训练输出路径存储在环境变量train_url中。 + {{.i18n.Tr "cloudbrain.dataset_path_rule"}}
- +
{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}} @@ -223,24 +223,24 @@
- +
- +
- +
{{.i18n.Tr "repo.cloudbrain.cancel"}}
- + - +
@@ -272,9 +272,9 @@ // 参数增加、删除、修改、保存 function Add_parameter(i){ value = '
' + - '
' + - ' ' + - '
' + + '
' + + ' ' + + '
' + '
' + '' + '
'+ @@ -284,7 +284,7 @@ '' + '
' $(".dynamic.field").append(value) - } + } $('#add_run_para').click(function(){ var len = $(".dynamic.field .two.fields").length @@ -310,7 +310,7 @@ $(this).find('input').each(function(){ parameters.push($(this).text()) }) - + }); $('.ui.parameter.modal') .modal('hide'); @@ -353,9 +353,9 @@ onChange: function(){ if ($('.ui.save.checkbox').checkbox('is checked')){ $('#save_para').removeClass("disabled") - + }else{ - $('#save_para').addClass("disabled") + $('#save_para').addClass("disabled") } } }); @@ -421,7 +421,7 @@ // $('.ui.page.dimmer').dimmer('show') document.getElementById("mask").style.display = "block" }, - onFailure: function(e){ + onFailure: function(e){ return false; } }) @@ -453,6 +453,6 @@ $('.ui.create_train_job.green.button').click(function(e) { get_name() send_run_para() - validate() + validate() }) - \ No newline at end of file + diff --git a/templates/repo/modelarts/trainjob/para_manage.tmpl b/templates/repo/modelarts/trainjob/para_manage.tmpl index e7e48f13b..64e769fa0 100755 --- a/templates/repo/modelarts/trainjob/para_manage.tmpl +++ b/templates/repo/modelarts/trainjob/para_manage.tmpl @@ -2,11 +2,11 @@
{{template "repo/header" .}} -
+
- {{template "repo/modelarts/navbar" .}} + {{template "repo/modelarts/navbar" .}} -
+

{{.i18n.Tr "repo.modelarts.train_job_para_admin"}}

@@ -29,7 +29,7 @@
- +
{{range .Tasks}} @@ -38,12 +38,12 @@ - - + +
{{.Status}}
@@ -59,7 +59,7 @@ 编辑
- +
@@ -69,7 +69,7 @@
- +
{{end}} {{template "base/paginate" .}} @@ -78,7 +78,7 @@
-
+
@@ -86,18 +86,18 @@
@@ -105,7 +105,7 @@
{{template "base/footer" .}} - \ No newline at end of file + diff --git a/templates/repo/modelarts/trainjob/version_new.tmpl b/templates/repo/modelarts/trainjob/version_new.tmpl index 0af0778ba..ed7334cac 100644 --- a/templates/repo/modelarts/trainjob/version_new.tmpl +++ b/templates/repo/modelarts/trainjob/version_new.tmpl @@ -97,7 +97,7 @@ {{end}}
- +
@@ -105,7 +105,7 @@

{{.i18n.Tr "repo.modelarts.train_job.parameter_setting"}}:

- +
@@ -119,7 +119,7 @@ {{end}} {{end}} - +
@@ -160,7 +160,7 @@ - 查看样例 + {{.i18n.Tr "cloudbrain.view_sample"}}
@@ -175,9 +175,9 @@ {{end}} {{end}} - 数据集位置存储在环境变量data_url中,训练输出路径存储在环境变量train_url中。 + {{.i18n.Tr "cloudbrain.dataset_path_rule"}}
- +
{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}} @@ -243,24 +243,24 @@
- +
- +
- +
{{.i18n.Tr "repo.cloudbrain.cancel"}}
- + - +
@@ -298,9 +298,9 @@ // 参数增加、删除、修改、保存 function Add_parameter(i){ value = '
' + - '
' + - ' ' + - '
' + + '
' + + ' ' + + '
' + '
' + '' + '
'+ @@ -310,7 +310,7 @@ '' + '
' $(".dynamic.field").append(value) - } + } $('#add_run_para').click(function(){ var len = $(".dynamic.field .two.fields").length @@ -336,7 +336,7 @@ $(this).find('input').each(function(){ parameters.push($(this).text()) }) - + }); $('.ui.parameter.modal') .modal('hide'); @@ -379,9 +379,9 @@ onChange: function(){ if ($('.ui.save.checkbox').checkbox('is checked')){ $('#save_para').removeClass("disabled") - + }else{ - $('#save_para').addClass("disabled") + $('#save_para').addClass("disabled") } } }); @@ -535,7 +535,7 @@ // $('.ui.page.dimmer').dimmer('show') document.getElementById("mask").style.display = "block" }, - onFailure: function(e){ + onFailure: function(e){ return false; } }) @@ -569,6 +569,6 @@ $('.ui.create_train_job.green.button').click(function(e) { get_name() send_run_para() - validate() + validate() }) - \ No newline at end of file + diff --git a/templates/repo/modelmanage/index.tmpl b/templates/repo/modelmanage/index.tmpl index 66d66ef16..e270da017 100644 --- a/templates/repo/modelmanage/index.tmpl +++ b/templates/repo/modelmanage/index.tmpl @@ -38,7 +38,7 @@
训练任务:您还没创建过训练任务,请先创建训练任务
{{end}}
使用说明:可以参考启智AI协作平台小白训练营课程。
- +
@@ -79,10 +79,10 @@
- 取消操作 + {{.i18n.Tr "cloudbrain.operate_cancel"}}
- 确定操作 + {{.i18n.Tr "cloudbrain.operate_confirm"}}
@@ -99,7 +99,7 @@
-
+
@@ -149,8 +149,8 @@
- - + + @@ -179,7 +179,7 @@ $("#job-name").empty() createModelName() loadTrainList() - + }, onHide:function(){ document.getElementById("formId").reset(); @@ -188,7 +188,7 @@ $('.ui.dimmer').css({"background-color":""}) $('.ui.error.message').text() $('.ui.error.message').css('display','none') - + } }) .modal('show') @@ -233,7 +233,7 @@ $('#choice_model .default.text').text(data[0].DisplayJobName) $('#choice_model input[name="JobId"]').val(data[0].JobID) loadTrainVersion() - + }) } function loadTrainVersion(value){ @@ -251,7 +251,7 @@ $('#choice_version .default.text').text(data[0].VersionName) $('#choice_version input[name="VersionName"]').val(data[0].VersionName) } - + }) } From 7d1db8224353a483617c38b52361842c4fb5a7e3 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Mon, 21 Mar 2022 11:11:43 +0800 Subject: [PATCH 03/12] #1627 update --- options/locale/locale_en-US.ini | 11 ++++++++- options/locale/locale_zh-CN.ini | 11 +++++++++ templates/repo/cloudbrain/benchmark/index.tmpl | 2 +- templates/repo/cloudbrain/benchmark/new.tmpl | 4 ++-- templates/repo/cloudbrain/new.tmpl | 6 ++--- templates/repo/modelarts/notebook/new.tmpl | 32 +++++++++++++------------- 6 files changed, 43 insertions(+), 23 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index aba6bfbf3..6a6005bec 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -869,7 +869,7 @@ gpu_type_all=All model_download=Model Download submit_image=Submit Image download=Download - +score=score cloudbrain=Cloudbrain cloudbrain.new=New cloudbrain @@ -2844,6 +2844,10 @@ snn4imagenet_path = Snn4imagenet script path brainscore_path = Brainscore script path start_command = Start command choose_mirror = select mirror or enter mirror path +select_dataset = select dataset +specification = specification +select_specification = select specification +description = description job_name_rule = Please enter letters, numbers, _ and - up to 64 characters and cannot end with a dash (-). dataset_path_rule = The dataset location is stored in the environment variable data_url, and the training output path is stored in the environment variable train_url. @@ -2855,3 +2859,8 @@ delete_task = Delete task task_delete_confirm = Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered. operate_confirm = confirm operate_cancel = cancel + +gpu_num = GPU +cpu_num = CPU +memory = Memory +shared_memory = Shared Memory diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 5a86801d0..9a01ae4c8 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -874,6 +874,7 @@ gpu_type_all=全部 model_download=结果下载 submit_image=提交镜像 download=模型下载 +score=评分 cloudbrain=云脑 cloudbrain.new=新建任务 @@ -2851,6 +2852,10 @@ snn4imagenet_path = snn4imagenet脚本存放路径 brainscore_path = brainscore脚本存放路径 start_command = 启动命令 choose_mirror = 选择镜像或输入镜像地址 +select_dataset = 选择数据集 +specification = 规格 +select_specification = 选择资源规格 +description = 描述 job_name_rule = 请输入字母、数字、_和-,最长64个字符,且不能以中划线(-)结尾。 dataset_path_rule = 数据集位置存储在环境变量data_url中,训练输出路径存储在环境变量train_url中。 @@ -2862,3 +2867,9 @@ delete_task = 删除任务 task_delete_confirm = 你确认删除该任务么?此任务一旦删除不可恢复。 operate_confirm = 确定操作 operate_cancel = 取消操作 + +gpu_num = GPU数 +cpu_num = CPU数 +memory = 内存 +shared_memory = 共享内存 + diff --git a/templates/repo/cloudbrain/benchmark/index.tmpl b/templates/repo/cloudbrain/benchmark/index.tmpl index a816a3e2b..989e3bfd2 100755 --- a/templates/repo/cloudbrain/benchmark/index.tmpl +++ b/templates/repo/cloudbrain/benchmark/index.tmpl @@ -155,7 +155,7 @@ {{end}} - 评分 + {{$.i18n.Tr "repo.stop"}} diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index da04f4be1..e7b1f0a77 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -140,9 +140,9 @@
- {{range .benchmark_resource_specs}} - + {{end}}
diff --git a/templates/repo/cloudbrain/new.tmpl b/templates/repo/cloudbrain/new.tmpl index 53ec56f8a..7ef6d25e8 100755 --- a/templates/repo/cloudbrain/new.tmpl +++ b/templates/repo/cloudbrain/new.tmpl @@ -203,7 +203,7 @@
- {{range .attachments}} @@ -213,9 +213,9 @@
- {{range .resource_specs}} - + {{end}}
diff --git a/templates/repo/modelarts/notebook/new.tmpl b/templates/repo/modelarts/notebook/new.tmpl index 17e7ba569..a91d98af1 100755 --- a/templates/repo/modelarts/notebook/new.tmpl +++ b/templates/repo/modelarts/notebook/new.tmpl @@ -30,7 +30,7 @@
- +
- +
- - {{range .images}} {{end}} @@ -61,8 +61,8 @@
- - + + {{range .attachments}} @@ -80,7 +80,7 @@
-->
- +
-->
- +
@@ -118,8 +118,8 @@ form.onsubmit = function(e){ let value_task = $("input[name='display_job_name']").val() - - + + let re = /^[a-z0-9][a-z0-9-_]{1,36}$/ let flag = re.test(value_task) if(!flag){ @@ -128,12 +128,12 @@ $('#messageInfo p').text(str) return false } - + let min_value_task = value_task.toLowerCase() - + $("input[name='display_job_name']").attr("value",min_value_task) document.getElementById("mask").style.display = "block" - + } // 点击按钮后遮罩层显示 // function showmask() { @@ -169,10 +169,10 @@ for (let i=0;i \ No newline at end of file + From c37d41c2f5e04f56d0863cdac5a184c83ebb8cd5 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Mon, 21 Mar 2022 11:39:01 +0800 Subject: [PATCH 04/12] #1627 update --- options/locale/locale_en-US.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 6a6005bec..e01eddcd4 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -862,6 +862,7 @@ model_noright=No right model_rename=Duplicate model name, please modify model name. debug=Debug +debug_again=Restart stop=Stop delete=Delete more=More From 436d91b700816f24653a6cadc3795176ca7c6276 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Mon, 21 Mar 2022 14:57:57 +0800 Subject: [PATCH 05/12] fix issue --- templates/repo/debugjob/index.tmpl | 2 +- web_src/js/features/cloudrbanin.js | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/templates/repo/debugjob/index.tmpl b/templates/repo/debugjob/index.tmpl index ab6e266af..ddcccc926 100755 --- a/templates/repo/debugjob/index.tmpl +++ b/templates/repo/debugjob/index.tmpl @@ -208,7 +208,7 @@ {{template "repo/header" .}} {{template "base/alert" .}} - +
diff --git a/web_src/js/features/cloudrbanin.js b/web_src/js/features/cloudrbanin.js index d069c6840..216226e14 100644 --- a/web_src/js/features/cloudrbanin.js +++ b/web_src/js/features/cloudrbanin.js @@ -1,4 +1,6 @@ export default async function initCloudrain() { + let debug_button = $('.cloudbrain_debug').data('debug') + let debug_again_button = $('.cloudbrain_debug').data('debug-again') let timeid = window.setInterval(loadJobStatus, 15000); $(document).ready(loadJobStatus); function loadJobStatus() { @@ -24,7 +26,7 @@ export default async function initCloudrain() { finalState.includes(status) && $('#' + ID + '-stop').removeClass('blue').addClass('disabled') } if(status==="RUNNING"){ - $('#ai-debug-'+ID).removeClass('disabled').addClass('blue').text('调试').css("margin","0 1rem") + $('#ai-debug-'+ID).removeClass('disabled').addClass('blue').text(debug_button).css("margin","0 1rem") $('#model-image-'+ID).removeClass('disabled').addClass('blue') } if(status!=="RUNNING"){ @@ -36,7 +38,7 @@ export default async function initCloudrain() { $('#ai-debug-'+ID).removeClass('blue').addClass('disabled') } if(['STOPPED','FAILED','START_FAILED','CREATE_FAILED','SUCCEEDED'].includes(status)){ - $('#ai-debug-'+ID).removeClass('disabled').addClass('blue').text('再次调试').css("margin","0") + $('#ai-debug-'+ID).removeClass('disabled').addClass('blue').text(debug_again_button).css("margin","0") } if(["RUNNING","WAITING"].includes(status)){ $('#ai-stop-'+ID).removeClass('disabled').addClass('blue') @@ -114,7 +116,7 @@ export default async function initCloudrain() { $('#' + ID+'-icon').removeClass().addClass(res.status) $('#' + ID+ '-text').text(res.status) if(res.status==="STOPPED"){ - $('#ai-debug-'+ID).removeClass('disabled').addClass('blue').text("再次调试").css("margin","0") + $('#ai-debug-'+ID).removeClass('disabled').addClass('blue').text(debug_again_button).css("margin","0") $('#ai-image-'+ID).removeClass('blue').addClass('disabled') $('#ai-model-debug-'+ID).removeClass('blue').addClass('disabled') $('#ai-delete-'+ID).removeClass('disabled').addClass('blue') @@ -214,7 +216,7 @@ export default async function initCloudrain() { $('#' + ID+ '-text').text(res.status) $('#ai-debug-'+ID).removeClass('blue').addClass('disabled') $('#ai-delete-'+ID).removeClass('blue').addClass('disabled') - $('#ai-debug-'+ID).text("调试").css("margin","0 1rem") + $('#ai-debug-'+ID).text(debug_button).css("margin","0 1rem") } }else{ $('.alert').html(res.error_msg).removeClass('alert-success').addClass('alert-danger').show().delay(2000).fadeOut(); From a4ad2cb7c834c1121bb39c163f94f89cf8dc1284 Mon Sep 17 00:00:00 2001 From: wangjr Date: Mon, 21 Mar 2022 15:10:03 +0800 Subject: [PATCH 06/12] =?UTF-8?q?fix-1657=20=E5=89=8D=E7=AB=AF=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=B1=95=E7=A4=BA=E6=96=B0=E5=A2=9E=E5=8A=A0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/js/components/ProAnalysis.vue | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/web_src/js/components/ProAnalysis.vue b/web_src/js/components/ProAnalysis.vue index 88ea67d94..d92eb6df9 100755 --- a/web_src/js/components/ProAnalysis.vue +++ b/web_src/js/components/ProAnalysis.vue @@ -148,6 +148,31 @@ prop="contributor" label="贡献者数" align="center"> + + + + + + + + +
@@ -1140,6 +1165,17 @@ return "
" +value.user+ "" } + }, + transformTimestamp(timestamp){ + let a = new Date(timestamp*1000); + const date = new Date(a); + const Y = date.getFullYear() + '/'; + const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '/'; + const D = (date.getDate() < 10 ? '0'+date.getDate() : date.getDate()) + ' '; + const h = (date.getHours() < 10 ? '0'+date.getHours() : date.getHours()) + ':'; + const m = (date.getMinutes() <10 ? '0'+date.getMinutes() : date.getMinutes()); + const dateString = Y + M + D + h + m ;//+ s; + return dateString; }, }, From 8e11b7bef37661393998a4f9c327844a78301f40 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Mon, 21 Mar 2022 15:13:36 +0800 Subject: [PATCH 07/12] #1627 update --- options/locale/locale_en-US.ini | 2 ++ options/locale/locale_zh-CN.ini | 2 +- routers/repo/cloudbrain.go | 25 ++++++++++++++----------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index e01eddcd4..dbe9c8985 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -992,6 +992,8 @@ cloudbrain.benchmark.evaluate_child_type=Child Type cloudbrain.benchmark.evaluate_mirror=Mirror cloudbrain.benchmark.evaluate_train=Train Script cloudbrain.benchmark.evaluate_test=Test Script +cloudbrain.benchmark.types={"type":[{"id":1,"first":"Target detection","second":[{"id":1,"value":"None","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"yangzhx","repo_name":"detection_benchmark_script"}]},{"id":2,"first":"Target Re-identification","second":[{"id":1,"value":"Vehicle re-identification","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"},{"id":2,"value":"Image-based person re-identification","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"}]}]} + modelarts.infer_job_model = Model modelarts.infer_job_model_file = Model File modelarts.infer_job = Inference Job diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 9a01ae4c8..09cf839c7 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -998,7 +998,7 @@ cloudbrain.benchmark.evaluate_child_type=子类型 cloudbrain.benchmark.evaluate_mirror=镜像 cloudbrain.benchmark.evaluate_train=训练程序 cloudbrain.benchmark.evaluate_test=测试程序 - +cloudbrain.benchmark.types={"type":[{"id":1,"first":"目标检测","second":[{"id":1,"value":"无","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"yangzhx","repo_name":"detection_benchmark_script"}]},{"id":2,"first":"目标重识别","second":[{"id":1,"value":"车辆重识别","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"},{"id":2,"value":"基于图像的行人重识别","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"}]}]} modelarts.infer_job_model = 模型名称 modelarts.infer_job_model_file = 模型文件 diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 6e88b266d..78ea8ea72 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "github.com/unknwon/i18n" "io" "net/http" "os" @@ -45,6 +46,8 @@ var ( benchmarkResourceSpecs *models.ResourceSpecs ) +const BENCHMARK_TYPE_CODE = "repo.cloudbrain.benchmark.types" + var jobNamePattern = regexp.MustCompile(`^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$`) // MustEnableDataset check if repository enable internal cb @@ -131,8 +134,8 @@ func cloudBrainNewDataPrepare(ctx *context.Context) error { ctx.Data["benchmark_categories"] = categories.Category if benchmarkTypes == nil { - if err := json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes); err != nil { - log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", setting.BenchmarkTypes, err, ctx.Data["MsgID"]) + if err := json.Unmarshal([]byte(i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE)), &benchmarkTypes); err != nil { + log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE), err, ctx.Data["MsgID"]) } } ctx.Data["benchmark_types"] = benchmarkTypes.BenchmarkType @@ -340,8 +343,8 @@ func CloudBrainRestart(ctx *context.Context) { func CloudBrainBenchMarkShow(ctx *context.Context) { if benchmarkTypes == nil { - if err := json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes); err != nil { - log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", setting.BenchmarkTypes, err, ctx.Data["MsgID"]) + if err := json.Unmarshal([]byte(i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE)), &benchmarkTypes); err != nil { + log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE), err, ctx.Data["MsgID"]) ctx.ServerError(err.Error(), err) return } @@ -1060,7 +1063,7 @@ func CloudBrainBenchmarkIndex(ctx *context.Context) { } if benchmarkTypes == nil { - if err := json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes); err != nil { + if err := json.Unmarshal([]byte(i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE)), &benchmarkTypes); err != nil { ctx.ServerError("Get BenchmarkTypes faild:", err) return } @@ -1103,8 +1106,8 @@ func GetChildTypes(ctx *context.Context) { re := make(map[string]interface{}) for { if benchmarkTypes == nil { - if err := json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes); err != nil { - log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", setting.BenchmarkTypes, err, ctx.Data["MsgID"]) + if err := json.Unmarshal([]byte(i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE)), &benchmarkTypes); err != nil { + log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE), err, ctx.Data["MsgID"]) re["errMsg"] = "system error" break } @@ -1141,11 +1144,11 @@ func CloudBrainBenchmarkNew(ctx *context.Context) { ctx.HTML(200, tplCloudBrainBenchmarkNew) } -func getBenchmarkAttachment(benchmarkTypeID, benchmarkChildTypeID int) (*models.BenchmarkDataset, error) { +func getBenchmarkAttachment(benchmarkTypeID, benchmarkChildTypeID int, ctx *context.Context) (*models.BenchmarkDataset, error) { var childInfo *models.BenchmarkDataset if benchmarkTypes == nil { - if err := json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes); err != nil { - log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", setting.BenchmarkTypes, err) + if err := json.Unmarshal([]byte(i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE)), &benchmarkTypes); err != nil { + log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE), err) return childInfo, err } } @@ -1265,7 +1268,7 @@ func CloudBrainBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainF return } - childInfo, err := getBenchmarkAttachment(benchmarkTypeID, benchmarkChildTypeID) + childInfo, err := getBenchmarkAttachment(benchmarkTypeID, benchmarkChildTypeID, ctx) if err != nil { log.Error("getBenchmarkAttachment failed:%v", err, ctx.Data["MsgID"]) cloudBrainNewDataPrepare(ctx) From 71e43839eab41dbaa3476336151e83fb4de7a524 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Mon, 21 Mar 2022 15:22:52 +0800 Subject: [PATCH 08/12] #1627 update --- templates/repo/modelarts/inferencejob/new.tmpl | 4 ++-- templates/repo/modelarts/trainjob/new.tmpl | 4 ++-- templates/repo/modelarts/trainjob/version_new.tmpl | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/repo/modelarts/inferencejob/new.tmpl b/templates/repo/modelarts/inferencejob/new.tmpl index 6f174bbbb..27d047783 100644 --- a/templates/repo/modelarts/inferencejob/new.tmpl +++ b/templates/repo/modelarts/inferencejob/new.tmpl @@ -171,12 +171,12 @@
     - {{if $.uuid}} {{end}} {{range .attachments}} - + {{end}} diff --git a/templates/repo/modelarts/trainjob/new.tmpl b/templates/repo/modelarts/trainjob/new.tmpl index 6ec48bc7d..8366f8a37 100755 --- a/templates/repo/modelarts/trainjob/new.tmpl +++ b/templates/repo/modelarts/trainjob/new.tmpl @@ -151,12 +151,12 @@
- {{if $.uuid}} {{end}} {{range .attachments}} - + {{end}} diff --git a/templates/repo/modelarts/trainjob/version_new.tmpl b/templates/repo/modelarts/trainjob/version_new.tmpl index ed7334cac..e69709a7c 100644 --- a/templates/repo/modelarts/trainjob/version_new.tmpl +++ b/templates/repo/modelarts/trainjob/version_new.tmpl @@ -164,12 +164,12 @@
- {{if .dataset_name}} {{end}} {{range .attachments}} - + {{if ne $.uuid .UUID}} {{end}} From e4390b601f51d3f00d7dceb9fc2122128d0bc5ea Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Mon, 21 Mar 2022 15:28:59 +0800 Subject: [PATCH 09/12] #1627 update --- templates/repo/modelarts/inferencejob/new.tmpl | 2 +- templates/repo/modelarts/trainjob/new.tmpl | 2 +- templates/repo/modelarts/trainjob/version_new.tmpl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/repo/modelarts/inferencejob/new.tmpl b/templates/repo/modelarts/inferencejob/new.tmpl index 27d047783..5e7347abf 100644 --- a/templates/repo/modelarts/inferencejob/new.tmpl +++ b/templates/repo/modelarts/inferencejob/new.tmpl @@ -176,7 +176,7 @@ {{end}} {{range .attachments}} - + {{end}} diff --git a/templates/repo/modelarts/trainjob/new.tmpl b/templates/repo/modelarts/trainjob/new.tmpl index 8366f8a37..afa09cf29 100755 --- a/templates/repo/modelarts/trainjob/new.tmpl +++ b/templates/repo/modelarts/trainjob/new.tmpl @@ -156,7 +156,7 @@ {{end}} {{range .attachments}} - + {{end}} diff --git a/templates/repo/modelarts/trainjob/version_new.tmpl b/templates/repo/modelarts/trainjob/version_new.tmpl index e69709a7c..b7fcd36ad 100644 --- a/templates/repo/modelarts/trainjob/version_new.tmpl +++ b/templates/repo/modelarts/trainjob/version_new.tmpl @@ -169,7 +169,7 @@ {{end}} {{range .attachments}} - + {{if ne $.uuid .UUID}} {{end}} From 5db959d68f9ada7b50a1751b8391abdedbf31d83 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Mon, 21 Mar 2022 15:40:49 +0800 Subject: [PATCH 10/12] #1627 update --- options/locale/locale_en-US.ini | 2 +- options/locale/locale_zh-CN.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index dbe9c8985..0b486117e 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -992,7 +992,7 @@ cloudbrain.benchmark.evaluate_child_type=Child Type cloudbrain.benchmark.evaluate_mirror=Mirror cloudbrain.benchmark.evaluate_train=Train Script cloudbrain.benchmark.evaluate_test=Test Script -cloudbrain.benchmark.types={"type":[{"id":1,"first":"Target detection","second":[{"id":1,"value":"None","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"yangzhx","repo_name":"detection_benchmark_script"}]},{"id":2,"first":"Target Re-identification","second":[{"id":1,"value":"Vehicle re-identification","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"},{"id":2,"value":"Image-based person re-identification","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"}]}]} +cloudbrain.benchmark.types={"type":[{"id":1,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=detection","first":"Target detection","second":[{"id":1,"value":"None","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"yangzhx","repo_name":"detection_benchmark_script"}]},{"id":2,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=reid","first":"Target re-identification","second":[{"id":1,"value":"Vehicle re-identification","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"},{"id":2,"value":"Image-based person re-identification","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"}]},{"id":3,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=tracking","first":"Multi-target tracking","second":[{"id":1,"value":"None","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"lix07","repo_name":"MOT_benchmark_script"}]}]} modelarts.infer_job_model = Model modelarts.infer_job_model_file = Model File diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 09cf839c7..5ef5cb8e6 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -998,7 +998,7 @@ cloudbrain.benchmark.evaluate_child_type=子类型 cloudbrain.benchmark.evaluate_mirror=镜像 cloudbrain.benchmark.evaluate_train=训练程序 cloudbrain.benchmark.evaluate_test=测试程序 -cloudbrain.benchmark.types={"type":[{"id":1,"first":"目标检测","second":[{"id":1,"value":"无","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"yangzhx","repo_name":"detection_benchmark_script"}]},{"id":2,"first":"目标重识别","second":[{"id":1,"value":"车辆重识别","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"},{"id":2,"value":"基于图像的行人重识别","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"}]}]} +cloudbrain.benchmark.types={"type":[{"id":1,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=detection","first":"目标检测","second":[{"id":1,"value":"无","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"yangzhx","repo_name":"detection_benchmark_script"}]},{"id":2,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=reid","first":"目标重识别","second":[{"id":1,"value":"车辆重识别","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"},{"id":2,"value":"基于图像的行人重识别","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"}]},{"id":3,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=tracking","first":"多目标跟踪","second":[{"id":1,"value":"无","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"lix07","repo_name":"MOT_benchmark_script"}]}]} modelarts.infer_job_model = 模型名称 modelarts.infer_job_model_file = 模型文件 From 4af02f5997955cea87ece96563213f0a234a250d Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Mon, 21 Mar 2022 16:23:33 +0800 Subject: [PATCH 11/12] #1627 fix bug --- routers/repo/cloudbrain.go | 58 +++++++++++++++++----------------------------- 1 file changed, 21 insertions(+), 37 deletions(-) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 78ea8ea72..65db818a0 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -48,6 +48,8 @@ var ( const BENCHMARK_TYPE_CODE = "repo.cloudbrain.benchmark.types" +var benchmarkTypesMap = make(map[string]*models.BenchmarkTypes, 0) + var jobNamePattern = regexp.MustCompile(`^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$`) // MustEnableDataset check if repository enable internal cb @@ -133,12 +135,7 @@ func cloudBrainNewDataPrepare(ctx *context.Context) error { } ctx.Data["benchmark_categories"] = categories.Category - if benchmarkTypes == nil { - if err := json.Unmarshal([]byte(i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE)), &benchmarkTypes); err != nil { - log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE), err, ctx.Data["MsgID"]) - } - } - ctx.Data["benchmark_types"] = benchmarkTypes.BenchmarkType + ctx.Data["benchmark_types"] = GetBenchmarkTypes(ctx).BenchmarkType if gpuInfos == nil { json.Unmarshal([]byte(setting.GpuTypes), &gpuInfos) @@ -342,13 +339,6 @@ func CloudBrainRestart(ctx *context.Context) { } func CloudBrainBenchMarkShow(ctx *context.Context) { - if benchmarkTypes == nil { - if err := json.Unmarshal([]byte(i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE)), &benchmarkTypes); err != nil { - log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE), err, ctx.Data["MsgID"]) - ctx.ServerError(err.Error(), err) - return - } - } cloudBrainShow(ctx, tplCloudBrainBenchmarkShow) } @@ -415,7 +405,7 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) { duration = int64(task.UpdatedUnix) - int64(task.CreatedUnix) } if task.BenchmarkTypeID > 0 { - for _, benchmarkType := range benchmarkTypes.BenchmarkType { + for _, benchmarkType := range GetBenchmarkTypes(ctx).BenchmarkType { if task.BenchmarkTypeID == benchmarkType.Id { ctx.Data["BenchmarkTypeName"] = benchmarkType.First for _, benchmarkChildType := range benchmarkType.Second { @@ -1062,13 +1052,6 @@ func CloudBrainBenchmarkIndex(ctx *context.Context) { return } - if benchmarkTypes == nil { - if err := json.Unmarshal([]byte(i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE)), &benchmarkTypes); err != nil { - ctx.ServerError("Get BenchmarkTypes faild:", err) - return - } - } - for i, task := range ciTasks { ciTasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain) ciTasks[i].Cloudbrain.ComputeResource = task.ComputeResource @@ -1081,7 +1064,7 @@ func CloudBrainBenchmarkIndex(ctx *context.Context) { ciTasks[i].TrainJobDuration = util.AddZero(duration/3600000) + ":" + util.AddZero(duration%3600000/60000) + ":" + util.AddZero(duration%60000/1000) ciTasks[i].BenchmarkTypeName = "" if task.BenchmarkTypeID > 0 { - for _, benchmarkType := range benchmarkTypes.BenchmarkType { + for _, benchmarkType := range GetBenchmarkTypes(ctx).BenchmarkType { if task.BenchmarkTypeID == benchmarkType.Id { ciTasks[i].BenchmarkTypeRankLink = benchmarkType.RankLink ciTasks[i].BenchmarkTypeName = benchmarkType.First @@ -1105,15 +1088,8 @@ func GetChildTypes(ctx *context.Context) { benchmarkTypeID := ctx.QueryInt("benchmark_type_id") re := make(map[string]interface{}) for { - if benchmarkTypes == nil { - if err := json.Unmarshal([]byte(i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE)), &benchmarkTypes); err != nil { - log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE), err, ctx.Data["MsgID"]) - re["errMsg"] = "system error" - break - } - } var isExist bool - for _, benchmarkType := range benchmarkTypes.BenchmarkType { + for _, benchmarkType := range GetBenchmarkTypes(ctx).BenchmarkType { if benchmarkTypeID == benchmarkType.Id { isExist = true re["child_types"] = benchmarkType.Second @@ -1146,15 +1122,9 @@ func CloudBrainBenchmarkNew(ctx *context.Context) { func getBenchmarkAttachment(benchmarkTypeID, benchmarkChildTypeID int, ctx *context.Context) (*models.BenchmarkDataset, error) { var childInfo *models.BenchmarkDataset - if benchmarkTypes == nil { - if err := json.Unmarshal([]byte(i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE)), &benchmarkTypes); err != nil { - log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", i18n.Tr(ctx.Locale.Language(), BENCHMARK_TYPE_CODE), err) - return childInfo, err - } - } var isExist bool - for _, benchmarkType := range benchmarkTypes.BenchmarkType { + for _, benchmarkType := range GetBenchmarkTypes(ctx).BenchmarkType { if benchmarkType.Id == benchmarkTypeID { for _, childType := range benchmarkType.Second { if childType.Id == benchmarkChildTypeID { @@ -1398,3 +1368,17 @@ func BenchmarkDel(ctx *context.Context) { ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain/benchmark") } } + +func GetBenchmarkTypes(ctx *context.Context) *models.BenchmarkTypes { + var lang = ctx.Locale.Language() + if benchmarkTypesMap[lang] == nil { + var val = i18n.Tr(lang, BENCHMARK_TYPE_CODE) + var tempType *models.BenchmarkTypes + if err := json.Unmarshal([]byte(val), &tempType); err != nil { + log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", val, err, ctx.Data["MsgID"]) + return &models.BenchmarkTypes{} + } + benchmarkTypesMap[lang] = tempType + } + return benchmarkTypesMap[lang] +} From 89f38638483b36c094b2e8b121d4a9c0c88b6a25 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Wed, 23 Mar 2022 09:29:22 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=88=97=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/api/v1/repo/repo_dashbord.go | 38 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/routers/api/v1/repo/repo_dashbord.go b/routers/api/v1/repo/repo_dashbord.go index b1f344d55..2c42f8a16 100644 --- a/routers/api/v1/repo/repo_dashbord.go +++ b/routers/api/v1/repo/repo_dashbord.go @@ -292,41 +292,41 @@ func getFileName(ctx *context.Context, beginTime time.Time, endTime time.Time, p func allProjectsPeroidHeader(ctx *context.Context) map[string]string { - return map[string]string{"A1": ctx.Tr("admin.repos.id"), "B1": ctx.Tr("admin.repos.projectName"), "C1": ctx.Tr("repo.owner"), "D1": ctx.Tr("admin.repos.isPrivate"), "E1": ctx.Tr("admin.repos.isFork"), "F1": ctx.Tr("admin.repos.isMirror"), "G1": ctx.Tr("admin.repos.openi"), "H1": ctx.Tr("admin.repos.visit"), "I1": ctx.Tr("admin.repos.download"), "J1": ctx.Tr("admin.repos.pr"), "K1": ctx.Tr("admin.repos.commit"), - "L1": ctx.Tr("admin.repos.watches"), "M1": ctx.Tr("admin.repos.stars"), "N1": ctx.Tr("admin.repos.forks"), "O1": ctx.Tr("admin.repos.issues"), "P1": ctx.Tr("admin.repos.closedIssues"), "Q1": ctx.Tr("admin.repos.contributor"), "R1": ctx.Tr("admin.repos.create")} + return map[string]string{"A1": ctx.Tr("admin.repos.id"), "B1": ctx.Tr("admin.repos.projectName"), "C1": ctx.Tr("repo.owner"), "D1": ctx.Tr("admin.repos.isPrivate"), "E1": ctx.Tr("admin.repos.openi"), "F1": ctx.Tr("admin.repos.visit"), "G1": ctx.Tr("admin.repos.download"), "H1": ctx.Tr("admin.repos.pr"), "I1": ctx.Tr("admin.repos.commit"), + "J1": ctx.Tr("admin.repos.watches"), "K1": ctx.Tr("admin.repos.stars"), "L1": ctx.Tr("admin.repos.forks"), "M1": ctx.Tr("admin.repos.issues"), "N1": ctx.Tr("admin.repos.closedIssues"), "O1": ctx.Tr("admin.repos.contributor"), "P1": ctx.Tr("admin.repos.isFork"), "Q1": ctx.Tr("admin.repos.isMirror"), "R1": ctx.Tr("admin.repos.create")} } func allProjectsPeroidValues(row int, rs *models.RepoStatistic, ctx *context.Context) map[string]string { - return map[string]string{getCellName("A", row): strconv.FormatInt(rs.RepoID, 10), getCellName("B", row): rs.DisplayName(), getCellName("C", row): rs.OwnerName, getCellName("D", row): getBoolDisplay(rs.IsPrivate, ctx), getCellName("E", row): getBoolDisplay(rs.IsFork, ctx), getCellName("F", row): getBoolDisplay(rs.IsMirror, ctx), getCellName("G", row): strconv.FormatFloat(rs.RadarTotal, 'f', 2, 64), - getCellName("H", row): strconv.FormatInt(rs.NumVisits, 10), getCellName("I", row): strconv.FormatInt(rs.NumDownloads, 10), getCellName("J", row): strconv.FormatInt(rs.NumPulls, 10), getCellName("K", row): strconv.FormatInt(rs.NumCommits, 10), - getCellName("L", row): strconv.FormatInt(rs.NumWatches, 10), getCellName("M", row): strconv.FormatInt(rs.NumStars, 10), getCellName("N", row): strconv.FormatInt(rs.NumForks, 10), getCellName("O", row): strconv.FormatInt(rs.NumIssues, 10), - getCellName("P", row): strconv.FormatInt(rs.NumClosedIssues, 10), getCellName("Q", row): strconv.FormatInt(rs.NumContributor, 10), getCellName("R", row): time.Unix(int64(rs.RepoCreatedUnix), 0).Format(CREATE_TIME_FORMAT), + return map[string]string{getCellName("A", row): strconv.FormatInt(rs.RepoID, 10), getCellName("B", row): rs.DisplayName(), getCellName("C", row): rs.OwnerName, getCellName("D", row): getBoolDisplay(rs.IsPrivate, ctx), getCellName("E", row): strconv.FormatFloat(rs.RadarTotal, 'f', 2, 64), + getCellName("F", row): strconv.FormatInt(rs.NumVisits, 10), getCellName("G", row): strconv.FormatInt(rs.NumDownloads, 10), getCellName("H", row): strconv.FormatInt(rs.NumPulls, 10), getCellName("I", row): strconv.FormatInt(rs.NumCommits, 10), + getCellName("J", row): strconv.FormatInt(rs.NumWatches, 10), getCellName("K", row): strconv.FormatInt(rs.NumStars, 10), getCellName("L", row): strconv.FormatInt(rs.NumForks, 10), getCellName("M", row): strconv.FormatInt(rs.NumIssues, 10), + getCellName("N", row): strconv.FormatInt(rs.NumClosedIssues, 10), getCellName("O", row): strconv.FormatInt(rs.NumContributor, 10), getCellName("P", row): getBoolDisplay(rs.IsFork, ctx), getCellName("Q", row): getBoolDisplay(rs.IsMirror, ctx), getCellName("R", row): time.Unix(int64(rs.RepoCreatedUnix), 0).Format(CREATE_TIME_FORMAT), } } func allProjectsOpenIHeader() map[string]string { - return map[string]string{"A1": "ID", "B1": "项目名称", "C1": "拥有者", "D1": "私有", "E1": "迁移", "F1": "镜像", "G1": "OpenI指数", - "H1": "影响力", "I1": "成熟度", "J1": "活跃度", "K1": "项目健康度", "L1": "团队健康度", "M1": "项目发展趋势", - "N1": "关注数", "O1": "点赞数", "P1": "派生数", "Q1": "代码下载量", "R1": "评论数", "S1": "浏览量", "T1": "已解决任务数", "U1": "版本发布数量", "V1": "有效开发年龄", - "W1": "数据集", "X1": "模型数", "Y1": "百科页面数量", "Z1": "提交数", "AA1": "任务数", "AB1": "PR数", "AC1": "版本发布数量", "AD1": "任务完成比例", "AE1": "贡献者数", "AF1": "关键贡献者数", - "AG1": "新人增长量", "AH1": "代码规模增长量", "AI1": "任务增长量", "AJ1": "新人增长量", "AK1": "提交增长量", "AL1": "评论增长量", "AM1": "项目创建时间", + return map[string]string{"A1": "ID", "B1": "项目名称", "C1": "拥有者", "D1": "私有", "E1": "OpenI指数", + "F1": "影响力", "G1": "成熟度", "H1": "活跃度", "I1": "项目健康度", "J1": "团队健康度", "K1": "项目发展趋势", + "L1": "关注数", "M1": "点赞数", "N1": "派生数", "O1": "代码下载量", "P1": "评论数", "Q1": "浏览量", "R1": "已解决任务数", "S1": "版本发布数量", "T1": "有效开发年龄", + "U1": "数据集", "V1": "模型数", "W1": "百科页面数量", "X1": "提交数", "Y1": "任务数", "Z1": "PR数", "AA1": "版本发布数量", "AB1": "任务完成比例", "AC1": "贡献者数", "AD1": "关键贡献者数", + "AE1": "新人增长量", "AF1": "代码规模增长量", "AG1": "任务增长量", "AH1": "新人增长量", "AI1": "提交增长量", "AJ1": "评论增长量", "AK1": "迁移", "AL1": "镜像", "AM1": "项目创建时间", } } func allProjectsOpenIValues(row int, rs *models.RepoStatistic, ctx *context.Context) map[string]string { - return map[string]string{getCellName("A", row): strconv.FormatInt(rs.RepoID, 10), getCellName("B", row): rs.DisplayName(), getCellName("C", row): rs.OwnerName, getCellName("D", row): getBoolDisplay(rs.IsPrivate, ctx), getCellName("E", row): getBoolDisplay(rs.IsFork, ctx), getCellName("F", row): getBoolDisplay(rs.IsMirror, ctx), getCellName("G", row): strconv.FormatFloat(rs.RadarTotal, 'f', 2, 64), - getCellName("H", row): strconv.FormatFloat(rs.Impact, 'f', 2, 64), getCellName("I", row): strconv.FormatFloat(rs.Completeness, 'f', 2, 64), getCellName("J", row): strconv.FormatFloat(rs.Liveness, 'f', 2, 64), getCellName("K", row): strconv.FormatFloat(rs.ProjectHealth, 'f', 2, 64), getCellName("L", row): strconv.FormatFloat(rs.TeamHealth, 'f', 2, 64), getCellName("M", row): strconv.FormatFloat(rs.Growth, 'f', 2, 64), - getCellName("N", row): strconv.FormatInt(rs.NumWatches, 10), getCellName("O", row): strconv.FormatInt(rs.NumStars, 10), getCellName("P", row): strconv.FormatInt(rs.NumForks, 10), getCellName("Q", row): strconv.FormatInt(rs.NumDownloads, 10), + return map[string]string{getCellName("A", row): strconv.FormatInt(rs.RepoID, 10), getCellName("B", row): rs.DisplayName(), getCellName("C", row): rs.OwnerName, getCellName("D", row): getBoolDisplay(rs.IsPrivate, ctx), getCellName("E", row): strconv.FormatFloat(rs.RadarTotal, 'f', 2, 64), + getCellName("F", row): strconv.FormatFloat(rs.Impact, 'f', 2, 64), getCellName("G", row): strconv.FormatFloat(rs.Completeness, 'f', 2, 64), getCellName("H", row): strconv.FormatFloat(rs.Liveness, 'f', 2, 64), getCellName("I", row): strconv.FormatFloat(rs.ProjectHealth, 'f', 2, 64), getCellName("J", row): strconv.FormatFloat(rs.TeamHealth, 'f', 2, 64), getCellName("K", row): strconv.FormatFloat(rs.Growth, 'f', 2, 64), + getCellName("L", row): strconv.FormatInt(rs.NumWatches, 10), getCellName("M", row): strconv.FormatInt(rs.NumStars, 10), getCellName("N", row): strconv.FormatInt(rs.NumForks, 10), getCellName("O", row): strconv.FormatInt(rs.NumDownloads, 10), - getCellName("R", row): strconv.FormatInt(rs.NumComments, 10), getCellName("S", row): strconv.FormatInt(rs.NumVisits, 10), getCellName("T", row): strconv.FormatInt(rs.NumClosedIssues, 10), getCellName("U", row): strconv.FormatInt(rs.NumVersions, 10), - getCellName("V", row): strconv.FormatInt(rs.NumDevMonths, 10), getCellName("W", row): strconv.FormatInt(rs.DatasetSize, 10), getCellName("X", row): strconv.FormatInt(rs.NumModels, 10), getCellName("Y", row): strconv.FormatInt(rs.NumWikiViews, 10), - getCellName("Z", row): strconv.FormatInt(rs.NumCommits, 10), getCellName("AA", row): strconv.FormatInt(rs.NumIssues, 10), getCellName("AB", row): strconv.FormatInt(rs.NumPulls, 10), getCellName("AC", row): strconv.FormatInt(rs.NumVersions, 10), - getCellName("AD", row): strconv.FormatFloat(float64(rs.IssueFixedRate), 'f', 2, 64), getCellName("AE", row): strconv.FormatInt(rs.NumContributor, 10), getCellName("AF", row): strconv.FormatInt(rs.NumKeyContributor, 10), getCellName("AG", row): strconv.FormatInt(rs.NumContributorsGrowth, 10), - getCellName("AH", row): strconv.FormatInt(rs.NumCommitLinesGrowth, 10), getCellName("AI", row): strconv.FormatInt(rs.NumIssuesGrowth, 10), getCellName("AJ", row): strconv.FormatInt(rs.NumContributorsGrowth, 10), getCellName("AK", row): strconv.FormatInt(rs.NumCommitsGrowth, 10), getCellName("AL", row): strconv.FormatInt(rs.NumCommentsGrowth, 10), getCellName("AM", row): time.Unix(int64(rs.RepoCreatedUnix), 0).Format(CREATE_TIME_FORMAT), + getCellName("P", row): strconv.FormatInt(rs.NumComments, 10), getCellName("Q", row): strconv.FormatInt(rs.NumVisits, 10), getCellName("R", row): strconv.FormatInt(rs.NumClosedIssues, 10), getCellName("S", row): strconv.FormatInt(rs.NumVersions, 10), + getCellName("T", row): strconv.FormatInt(rs.NumDevMonths, 10), getCellName("U", row): strconv.FormatInt(rs.DatasetSize, 10), getCellName("V", row): strconv.FormatInt(rs.NumModels, 10), getCellName("W", row): strconv.FormatInt(rs.NumWikiViews, 10), + getCellName("X", row): strconv.FormatInt(rs.NumCommits, 10), getCellName("Y", row): strconv.FormatInt(rs.NumIssues, 10), getCellName("Z", row): strconv.FormatInt(rs.NumPulls, 10), getCellName("AA", row): strconv.FormatInt(rs.NumVersions, 10), + getCellName("AB", row): strconv.FormatFloat(float64(rs.IssueFixedRate), 'f', 2, 64), getCellName("AC", row): strconv.FormatInt(rs.NumContributor, 10), getCellName("AD", row): strconv.FormatInt(rs.NumKeyContributor, 10), getCellName("AE", row): strconv.FormatInt(rs.NumContributorsGrowth, 10), + getCellName("AF", row): strconv.FormatInt(rs.NumCommitLinesGrowth, 10), getCellName("AG", row): strconv.FormatInt(rs.NumIssuesGrowth, 10), getCellName("AH", row): strconv.FormatInt(rs.NumContributorsGrowth, 10), getCellName("AI", row): strconv.FormatInt(rs.NumCommitsGrowth, 10), getCellName("AJ", row): strconv.FormatInt(rs.NumCommentsGrowth, 10), getCellName("AK", row): getBoolDisplay(rs.IsFork, ctx), getCellName("AL", row): getBoolDisplay(rs.IsMirror, ctx), getCellName("AM", row): time.Unix(int64(rs.RepoCreatedUnix), 0).Format(CREATE_TIME_FORMAT), } }