Browse Source

update lang

pull/3035/head
chenshihai 2 years ago
parent
commit
89a07584b7
4 changed files with 43 additions and 40 deletions
  1. +10
    -0
      options/locale/locale_en-US.ini
  2. +9
    -1
      options/locale/locale_zh-CN.ini
  3. +5
    -5
      templates/repo/modelsafety/new.tmpl
  4. +19
    -34
      templates/repo/modelsafety/show.tmpl

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

@@ -3258,3 +3258,13 @@ hours = Hours
expected_time = , expected to be available for
points_acquisition_instructions = Points Acquisition Instructions
insufficient_points_balance = Insufficient points balance

[modelsafety]
model_security_evaluation = Model Security Evaluation
base_data_set = Base Data Set
combat_data_set = Combat Data Set
evaluation_indicators = Evaluation Indicators
evaluation_result = Evaluation Result
no_data = No Data
untargetted = Untargetted
targetted = targetted

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

@@ -3278,4 +3278,12 @@ expected_time = ,预计可用
points_acquisition_instructions = 积分获取说明
insufficient_points_balance = 积分余额不足


[modelsafety]
model_security_evaluation = 模型安全评测
base_data_set = 原始数据集
combat_data_set = 对抗数据集
evaluation_indicators = 评测指标
evaluation_result = 评测结果
no_data = 无数据
untargetted = 非定向
targetted = 定向

+ 5
- 5
templates/repo/modelsafety/new.tmpl View File

@@ -68,7 +68,7 @@
<a class="item model_benchmark"
href="{{.RepoLink}}/cloudbrain/benchmark/create?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a>
<a class="item active model_safe_benchmark"
href="{{.Link}}">模型安全评测</a>
href="{{.Link}}">{{.i18n.Tr "modelsafety.model_security_evaluation"}}</a>
</div>
</div>
<!-- <div class="required unite min_title inline field">
@@ -240,17 +240,17 @@
<a href="https://git.openi.org.cn/OpenIOSSG/MNIST_PytorchExample_GPU" target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a>
</div>
<div class="inline field min_title required">
<label class="label-fix-width" style="font-weight: normal;">原始数据集</label>
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "modelsafety.base_data_set"}}</label>
<select id="baseDataSet-sel" class="ui dropdown width48" name="src_dataset"></select>
</div>
<div class="inline field min_title required">
<label class="label-fix-width" style="font-weight: normal;">对抗数据集</label>
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "modelsafety.combat_data_set"}}</label>
<select id="combatDataSet-sel" class="ui dropdown width48 readonly" name="combat_dataset"></select>
</div>
<div class="inline min_title field required">
<label class="label-fix-width" style="font-weight:normal;">评测指标</label>
<label class="label-fix-width" style="font-weight:normal;">{{.i18n.Tr "modelsafety.evaluation_indicators"}}</label>
<input type="text" style="display:none;" name="evaluation_index" />
<select id="job_indicators" class="ui dropdown width48 v-middle" multiple placeholder="选择评测指标" style='width:385px;'>
<select id="job_indicators" class="ui dropdown width48 v-middle" multiple style='width:385px;'>
<option value="ACC">ACC</option>
<option value="CAV">CAV</option>
<option value="ASS">ASS</option>


+ 19
- 34
templates/repo/modelsafety/show.tmpl View File

@@ -251,7 +251,7 @@
<div class="ui pointing secondary menu" style="border-bottom: 1px solid rgba(34,36,38,.15);">
<a class="active item" data-tab="first0">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a>
<a class="item log_bottom" data-tab="second0" data-version="">{{$.i18n.Tr "repo.modelarts.log"}}</a>
<a class="item" data-tab="third0" data-version="">评测结果</a>
<a class="item" data-tab="third0" data-version="">{{.i18n.Tr "modelsafety.evaluation_result"}}</a>
</div>
<div class="ui tab active" data-tab="first0">
<div style="padding-top: 10px;">
@@ -313,16 +313,16 @@
<tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80" vimagetitle="Image">
<span style="display:none;">{{$.i18n.Tr "cloudbrain.mirror"}}</span>
<span style="display:none;">{{$.i18n.Tr "cloudbrain.AI_driver"}}</span>
<span style="display:none;">{{$.i18n.Tr "repo.modelarts.train_job.AI_driver"}}</span>
</td>

<td class="ti-text-form-content">
<div class="text-span text-span-w" id="-mirror">
<span class="ui poping up clipboard" data-position="top center" id="clipboard-btn" style="cursor:pointer"
data-clipboard-text="{{.Image}}"
data-success="{{$.i18n.Tr "repo.copy_link_success"}}"
data-error="{{$.i18n.Tr "repo.copy_link_error"}}"
data-content="{{$.i18n.Tr "repo.copy_link"}}"
data-success="{{$.i18n.Tr "repo.copied"}}"
data-error="{{$.i18n.Tr "repo.copied_error"}}"
data-content="{{$.i18n.Tr "repo.copy"}}"
data-variation="inverted tiny"
vdataclipboardtext="Image"
>
@@ -348,7 +348,7 @@
</tr>
<tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80">
原始数据集
{{.i18n.Tr "modelsafety.base_data_set"}}
</td>
<td class="ti-text-form-content">
<div class="text-span text-span-w" vdataset0="DatasetName"></div>
@@ -356,7 +356,7 @@
</tr>
<tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80">
对抗数据集
{{.i18n.Tr "modelsafety.combat_data_set"}}
</td>
<td class="ti-text-form-content">
<div class="text-span text-span-w" vdataset1="DatasetName"></div>
@@ -394,7 +394,7 @@
</tr>
<tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80">
{{$.i18n.Tr "cloudbrain.gpu_type"}}
<span>{{$.i18n.Tr "repo.modelarts.train_job.resource_type"}}</span>
</td>
<td class="ti-text-form-content resorce_type">
<div class="text-span text-span-w"></div>
@@ -452,7 +452,7 @@
</tr>
<tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80">
评测指标
{{.i18n.Tr "modelsafety.evaluation_indicators"}}
</td>
<td class="ti-text-form-content">
<div class="text-span text-span-w" vfield="LabelName"></div>
@@ -565,7 +565,7 @@
{{template "repo/modelsafety/indicators_descr".}}
</div>
<div class="__res_container">
<div class="__res_no_data">无数据</div>
<div class="__res_no_data">{{.i18n.Tr "modelsafety.no_data"}}</div>
</div>
</div>
</div>
@@ -598,21 +598,6 @@

<script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script>

<script>
;(function() {
var SPEC = {{ $.Spec }};
var showPoint = false;
var specStr = window.renderSpecStr(SPEC, showPoint, {
gpu_memory: {{$.i18n.Tr "cloudbrain.gpu_memory"}},
free: {{$.i18n.Tr "cloudbrain.free"}},
point_hr: {{$.i18n.Tr "cloudbrain.point_hr"}},
memory: {{$.i18n.Tr "cloudbrain.memory"}},
shared_memory: {{$.i18n.Tr "cloudbrain.shared_memory"}},
});
$('td.ti-text-form-content.spec div').text(specStr);
SPEC && $('td.ti-text-form-content.resorce_type div').text(getListValueWithKey(ACC_CARD_TYPE, SPEC.AccCardType));
})();
</script>
<script>
;(function() {
function paddingZeros(str, len) {
@@ -635,8 +620,8 @@
<tr class="tr-head"><th style="width:100px;">${data.indicator}</th></tr>
</thead>
<tbody>
<tr class="tr-untargetted"><td>非定向</td></tr>
<tr class="tr-targetted"><td>定向</td></tr>
<tr class="tr-untargetted"><td>{{.i18n.Tr "modelsafety.untargetted"}}</td></tr>
<tr class="tr-targetted"><td>{{.i18n.Tr "modelsafety.targetted"}}</td></tr>
</tbody>
</table>`);
var trHead = tableEl.find('tr.tr-head');
@@ -664,7 +649,7 @@
},
color: ['rgb(80, 135, 236)', 'rgb(104, 187, 196)'],
legend: {
data: ['非定向', '定向'],
data: ['{{.i18n.Tr "modelsafety.untargetted"}}', '{{.i18n.Tr "modelsafety.targetted"}}'],
top: '15',
},
grid: {
@@ -683,13 +668,13 @@
},
series: [
{
name: '非定向',
name: '{{.i18n.Tr "modelsafety.untargetted"}}',
type: 'line',
stack: 'Total',
data: data.untargetted || [],
},
{
name: '定向',
name: '{{.i18n.Tr "modelsafety.targetted"}}',
type: 'line',
stack: 'Total',
data: data.targetted || [],
@@ -763,20 +748,20 @@
$(`[vdatajobid="${key}"]`).attr('data-jobid', res[key]);
}

var imageName = res['Image'] || res['EngineName'];
var imageName = res['Image'] || res['EngineName'];
$(`[vimagetitle="Image"] span`).hide();
if (res.Type === 0) {
imageName = res['Image'];
$(`[vimagetitle="Image"] span`).eq(0).show();
} else {
imageName = res['EngineName'];
$(`[vimagetitle="Image"] span`).eq(1).show();
$(`[vimagetitle="Image"] span`).eq(1).show();
}
$(`[vdataclipboardtext="Image"]`).attr('data-clipboard-text', imageName);
$(`[vimage="Image"]`).text(imageName);
$(`[vtitle="Image"]`).attr('title', imageName);
$(`[vuser="User.Name"]`).text(res['User'] && res['User']['Name']);
if (res.Spec) {
var SPEC = res.Spec;
var showPoint = false;
@@ -803,7 +788,7 @@
initData();
$(document).ready(function () {
$('.ui.accordion').accordion({ selector: { trigger: '.icon' } });
$('.ui.accordion').accordion({ selector: { trigger: '.icon' } });
});

$('.pointing.secondary.menu .item').tab({


Loading…
Cancel
Save