Skip to content

Commit

Permalink
New fine tuning instance model ID input box Error message adjustment (#…
Browse files Browse the repository at this point in the history
…678)

* Validate model id

* Update zh to en

---------

Co-authored-by: 朱鑫睿 <[email protected]>
  • Loading branch information
zzxr6 and 朱鑫睿 authored Sep 27, 2024
1 parent 3d33f93 commit de71e45
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frontend/src/components/endpoints/NewEndpoint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@
{
required: true,
message: t('all.pleaseInput', { value: t('endpoints.new.modelId') }),
trigger: 'change'
},
// Make sure to include a / in the string, but not at the beginning or end
{
pattern: /^(?!\/)[a-zA-Z0-9-_\.]+\/[a-zA-Z0-9-_\.]+(?<!\/)$/,
message: t('all.inputFormatError'),
trigger: 'blur'
}
],
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/components/finetune/NewFinetune.vue
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@
{
required: true,
message: t('all.pleaseInput', { value: t('finetune.new.modelId') }),
trigger: 'change'
},
// Make sure to include a / in the string, but not at the beginning or end
{
pattern: /^(?!\/)[a-zA-Z0-9-_\.]+\/[a-zA-Z0-9-_\.]+(?<!\/)$/,
message: t('all.inputFormatError'),
trigger: 'blur'
}
],
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/en_js/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const all = {
lfsTips2: "If you do not want to download the content of LFS files, please add it to the environment variables.",
pleaseSelect: "Please select {value}",
pleaseInput: "Please input {value}",
inputFormatError: "The input format is incorrect",
languages: "Languages",
previous:"Previous",
next:"Next",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/zh_js/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const all = {
lfsTips2: "如果您不想下载LFS文件的内容,请在环境变量中添加",
pleaseSelect: "请选择{value}",
pleaseInput: "请输入{value}",
inputFormatError: "输入格式不正确",
languages: "语言",
previous:"上一页",
next:"下一页",
Expand Down

0 comments on commit de71e45

Please sign in to comment.