From 7936d0063d632474ce158ff139c85cbe0ccbdda7 Mon Sep 17 00:00:00 2001 From: jialin Date: Fri, 17 Oct 2025 16:02:39 +0800 Subject: [PATCH] chore: update models locales --- src/components/auto-tooltip/index.tsx | 4 +- src/locales/en-US/models.ts | 15 +++++-- src/locales/ja-JP/models.ts | 28 ++++++++++-- src/locales/ru-RU/models.ts | 29 +++++++++++- src/locales/zh-CN/models.ts | 14 +++++- .../llmodels/components/catalog-item.tsx | 8 +++- src/pages/llmodels/forms/performance.tsx | 44 ++++++++++++++----- .../llmodels/forms/speculative-decode.tsx | 26 +++++++---- 8 files changed, 136 insertions(+), 32 deletions(-) diff --git a/src/components/auto-tooltip/index.tsx b/src/components/auto-tooltip/index.tsx index 41b8a7d7..284c7fe6 100644 --- a/src/components/auto-tooltip/index.tsx +++ b/src/components/auto-tooltip/index.tsx @@ -121,9 +121,9 @@ const AutoTooltip: React.FC = ({ className={`${tagProps.className || ''} ${filled ? 'tag-filled' : ''}`} ref={contentRef} style={{ - ...tagStyle, paddingInline: tagProps.closable ? '8px 22px' : 8, - borderRadius: radius + borderRadius: radius, + ...tagStyle }} closeIcon={ tagProps.closable ? ( diff --git a/src/locales/en-US/models.ts b/src/locales/en-US/models.ts index 0f74d1aa..88baf7bd 100644 --- a/src/locales/en-US/models.ts +++ b/src/locales/en-US/models.ts @@ -219,10 +219,19 @@ export default { 'Ratio of system RAM to GPU VRAM used for KV cache. For example, 2.0 means the cache in RAM can be twice as large as the GPU VRAM.', 'models.form.ramSize.tips': `Maximum size of the KV cache stored in system memory (GiB). If set, this value overrides "{content}".`, 'models.form.chunkSize.tips': 'Number of tokens per KV cache chunk.', - 'models.form.flavor.throughput.tips': + 'models.form.mode': 'Mode', + 'models.form.algorithm': 'Algorithm', + 'models.form.draftModel': 'Draft Model', + 'models.form.numDraftTokens': 'Number of Draft Tokens', + 'models.form.ngramMinMatchLength': 'N-gram Minimum Match Length', + 'models.form.ngramMaxMatchLength': 'N-gram Maximum Match Length', + 'models.form.mode.throughput': 'Throughput', + 'models.form.mode.latency': 'Latency', + 'models.form.mode.reference': 'Reference', + 'models.form.mode.throughput.tips': 'optimized for high throughput under high request concurrency.', - 'models.form.flavor.latency.tips': + 'models.form.mode.latency.tips': 'optimized for low latency under low request concurrency.', - 'models.form.flavor.reference.tips': + 'models.form.mode.reference.tips': 'the most compatible option with full precision.' }; diff --git a/src/locales/ja-JP/models.ts b/src/locales/ja-JP/models.ts index 29f9d4f6..7a04de0c 100644 --- a/src/locales/ja-JP/models.ts +++ b/src/locales/ja-JP/models.ts @@ -219,11 +219,20 @@ export default { 'Ratio of system RAM to GPU VRAM used for KV cache. For example, 2.0 means the cache in RAM can be twice as large as the GPU VRAM.', 'models.form.ramSize.tips': `Maximum size of the KV cache stored in system memory (GiB). If set, this value overrides "{content}".`, 'models.form.chunkSize.tips': 'Number of tokens per KV cache chunk.', - 'models.form.flavor.throughput.tips': + 'models.form.mode': 'Mode', + 'models.form.algorithm': 'Algorithm', + 'models.form.draftModel': 'Draft Model', + 'models.form.numDraftTokens': 'Number of Draft Tokens', + 'models.form.ngramMinMatchLength': 'N-gram Minimum Match Length', + 'models.form.ngramMaxMatchLength': 'N-gram Maximum Match Length', + 'models.form.mode.throughput': 'Throughput', + 'models.form.mode.latency': 'Latency', + 'models.form.mode.reference': 'Reference', + 'models.form.mode.throughput.tips': 'optimized for high throughput under high request concurrency.', - 'models.form.flavor.latency.tips': + 'models.form.mode.latency.tips': 'optimized for low latency under low request concurrency.', - 'models.form.flavor.reference.tips': + 'models.form.mode.reference.tips': 'the most compatible option with full precision.' }; @@ -277,4 +286,17 @@ export default { // 49. 'models.form.ramRatio.tips': 'Ratio of system RAM to GPU VRAM used for KV cache. For example, 2.0 means the cache in RAM can be twice as large as the GPU VRAM.', // 50. 'models.form.ramSize.tips': `Maximum size of the KV cache stored in system memory (GiB). If set, this value overrides "{content}".`, // 51. 'models.form.chunkSize.tips': 'Number of tokens per KV cache chunk.' +// 33. 'models.form.mode': 'Mode', +// 34. 'models.form.algorithm': 'Algorithm', +// 35. 'models.form.draftModel': 'Draft Model', +// 36. 'models.form.numDraftTokens': 'Number of Draft Tokens', +// 37. 'models.form.ngramMinMatchLength': 'N-gram Minimum Match Length', +// 38. 'models.form.ngramMaxMatchLength': 'N-gram Maximum Match Length', +// 39. 'models.form.mode.throughput': 'Throughput', +// 40. 'models.form.mode.latency': 'Latency', +// 41. 'models.form.mode.reference': 'Reference', +// 42. 'models.form.mode.throughput.tips': 'optimized for high throughput under high request concurrency.', +// 43. 'models.form.mode.latency.tips': 'optimized for low latency under low request concurrency.', +// 44. 'models.form.mode.reference.tips': 'the most compatible option with full precision + // ========== End of To-Do List ========== diff --git a/src/locales/ru-RU/models.ts b/src/locales/ru-RU/models.ts index 629a6f8f..0d4be6d4 100644 --- a/src/locales/ru-RU/models.ts +++ b/src/locales/ru-RU/models.ts @@ -218,7 +218,22 @@ export default { 'models.form.ramRatio.tips': 'Ratio of system RAM to GPU VRAM used for KV cache. For example, 2.0 means the cache in RAM can be twice as large as the GPU VRAM.', 'models.form.ramSize.tips': `Maximum size of the KV cache stored in system memory (GiB). If set, this value overrides "{content}".`, - 'models.form.chunkSize.tips': 'Number of tokens per KV cache chunk.' + 'models.form.chunkSize.tips': 'Number of tokens per KV cache chunk.', + 'models.form.mode': 'Mode', + 'models.form.algorithm': 'Algorithm', + 'models.form.draftModel': 'Draft Model', + 'models.form.numDraftTokens': 'Number of Draft Tokens', + 'models.form.ngramMinMatchLength': 'N-gram Minimum Match Length', + 'models.form.ngramMaxMatchLength': 'N-gram Maximum Match Length', + 'models.form.mode.throughput': 'Throughput', + 'models.form.mode.latency': 'Latency', + 'models.form.mode.reference': 'Reference', + 'models.form.mode.throughput.tips': + 'optimized for high throughput under high request concurrency.', + 'models.form.mode.latency.tips': + 'optimized for low latency under low request concurrency.', + 'models.form.mode.reference.tips': + 'the most compatible option with full precision.' }; // ========== To-Do: Translate Keys (Remove After Translation) ========== @@ -234,4 +249,16 @@ export default { // 11. 'models.form.ramRatio.tips': 'Ratio of system RAM to GPU VRAM used for KV cache. For example, 2.0 means the cache in RAM can be twice as large as the GPU VRAM.', // 12. 'models.form.ramSize.tips': `Maximum size of the KV cache stored in system memory (GiB). If set, this value overrides "{content}".`, // 13. 'models.form.chunkSize.tips': 'Number of tokens per KV cache chunk.' +// 25. 'models.form.mode': 'Mode', +// 26. 'models.form.algorithm': 'Algorithm', +// 27. 'models.form.draftModel': 'Draft Model', +// 28. 'models.form.numDraftTokens': 'Number of Draft Tokens', +// 29. 'models.form.ngramMinMatchLength': 'N-gram Minimum Match Length', +// 30. 'models.form.ngramMaxMatchLength': 'N-gram Maximum Match Length', +// 31. 'models.form.mode.throughput': 'Throughput', +// 32. 'models.form.mode.latency': 'Latency', +// 33. 'models.form.mode.reference': 'Reference', +// 34. 'models.form.mode.throughput.tips': 'optimized for high throughput under high request concurrency.', +// 35. 'models.form.mode.latency.tips': 'optimized for low latency under low request concurrency.', +// 36. 'models.form.mode.reference.tips': 'the most compatible option with full precision.' // ========== End of To-Do List ========== diff --git a/src/locales/zh-CN/models.ts b/src/locales/zh-CN/models.ts index 423df50a..8e1518ba 100644 --- a/src/locales/zh-CN/models.ts +++ b/src/locales/zh-CN/models.ts @@ -208,5 +208,17 @@ export default { 'KV 缓存在系统内存与 GPU 显存之间的比例。例如设置为 2.0 表示系统内存中可缓存的数据量是显存的两倍。', 'models.form.ramSize.tips': `KV 缓存在系统内存中的最大值。当设置该值时,将覆盖 "{content}" 的配置。`, 'models.form.chunkSize.tips': - '每个 KV 缓存块包含的 token 数量。数值越大可提升吞吐量,但也会增加内存占用。' + '每个 KV 缓存块包含的 token 数量。数值越大可提升吞吐量,但也会增加内存占用。', + 'models.form.mode': '模式', + 'models.form.algorithm': '算法', + 'models.form.draftModel': '草稿模型', + 'models.form.numDraftTokens': '草稿生成 Token 数', + 'models.form.ngramMinMatchLength': 'N-gram 最小匹配长度', + 'models.form.ngramMaxMatchLength': 'N-gram 最大匹配长度', + 'models.form.mode.throughput': '高吞吐', + 'models.form.mode.latency': '低延迟', + 'models.form.mode.reference': '参考', + 'models.form.mode.throughput.tips': '在高并发请求下优化吞吐性能。', + 'models.form.mode.latency.tips': '在低并发请求下优化响应延迟。', + 'models.form.mode.reference.tips': '最兼容且保留完整精度的选项。' }; diff --git a/src/pages/llmodels/components/catalog-item.tsx b/src/pages/llmodels/components/catalog-item.tsx index 13a52bea..d54f71ef 100644 --- a/src/pages/llmodels/components/catalog-item.tsx +++ b/src/pages/llmodels/components/catalog-item.tsx @@ -152,11 +152,15 @@ const CatalogItem: React.FC = (props) => { ); })} - + {data.activated_size ? `${data.size}B-A${data.activated_size}B` : `${data.size}B`} - + diff --git a/src/pages/llmodels/forms/performance.tsx b/src/pages/llmodels/forms/performance.tsx index 9838d0e2..6a0fbf09 100644 --- a/src/pages/llmodels/forms/performance.tsx +++ b/src/pages/llmodels/forms/performance.tsx @@ -8,18 +8,27 @@ import { useFormContext } from '../config/form-context'; import KVCacheForm from './kv-cache'; import SpeculativeDecode from './speculative-decode'; -const flavorTipsList = [ +const modeTipsList = [ { - title: 'Throughput', - tips: 'models.form.flavor.throughput.tips' + title: { + text: 'models.form.mode.throughput', + locale: true + }, + tips: 'models.form.mode.throughput.tips' }, { - title: 'Latency', - tips: 'models.form.flavor.latency.tips' + title: { + text: 'models.form.mode.latency', + locale: true + }, + tips: 'models.form.mode.latency.tips' }, { - title: 'Reference', - tips: 'models.form.flavor.reference.tips' + title: { + text: 'models.form.mode.reference', + locale: true + }, + tips: 'models.form.mode.reference.tips' } ]; @@ -34,12 +43,23 @@ const Performance: React.FC = () => { {formKey === deployFormKeyMap.catalog && ( } - label="Mode" + description={} + label={intl.formatMessage({ id: 'models.form.mode' })} options={[ - { label: 'Throughput', value: 'throughput' }, - { label: 'Latency', value: 'latency' }, - { label: 'Reference', value: 'reference' } + { + label: intl.formatMessage({ + id: 'models.form.mode.throughput' + }), + value: 'throughput' + }, + { + label: intl.formatMessage({ id: 'models.form.mode.latency' }), + value: 'latency' + }, + { + label: intl.formatMessage({ id: 'models.form.mode.reference' }), + value: 'reference' + } ]} > diff --git a/src/pages/llmodels/forms/speculative-decode.tsx b/src/pages/llmodels/forms/speculative-decode.tsx index 33b98e46..5855cd37 100644 --- a/src/pages/llmodels/forms/speculative-decode.tsx +++ b/src/pages/llmodels/forms/speculative-decode.tsx @@ -67,7 +67,9 @@ const SpeculativeDecode = () => { style={{ marginBottom: 8 }} > @@ -78,13 +80,17 @@ const SpeculativeDecode = () => { rules={[ { required: true, - message: getRuleMessage('select', 'Algorithm', false) + message: getRuleMessage( + 'select', + 'models.form.algorithm', + false + ) } ]} > { rules={[ { required: true, - message: getRuleMessage('select', 'Draft Model', false) + message: getRuleMessage('select', 'models.form.draftModel') } ]} > @@ -113,7 +119,7 @@ const SpeculativeDecode = () => { name={['speculative_config', 'num_draft_tokens']} > { name={['speculative_config', 'ngram_min_match_length']} > @@ -134,7 +142,9 @@ const SpeculativeDecode = () => { name={['speculative_config', 'ngram_max_match_length']} >