From 9b24dd8038871e2c55a792cd13da396de2de4775 Mon Sep 17 00:00:00 2001 From: jialin Date: Thu, 12 Dec 2024 11:42:44 +0800 Subject: [PATCH 1/2] fix: disable vox-box item when deploy ollama model --- src/locales/README.md | 30 +++++++++++++++++++ .../llmodels/components/advance-config.tsx | 2 +- src/pages/playground/config/params-config.ts | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 src/locales/README.md diff --git a/src/locales/README.md b/src/locales/README.md new file mode 100644 index 00000000..fdda686a --- /dev/null +++ b/src/locales/README.md @@ -0,0 +1,30 @@ +# Adding a New Language Configuration + +To add a new language configuration, follow these steps: + +1. **Duplicate an Existing Language Directory** + + - Choose any existing language directory that you are familiar with, and duplicate it. + - Name the new directory according to the `lang` attribute specified in `lang-config-map.tsx`. + +2. **Create a New `.ts` File in the Current Directory** + + - In the `locales` directory, create a `.ts` file named to align with the new directory. + - Copy the contents of the `en-US.ts` file into this new `.ts` file. + - Update the following line to match your new language directory: + ```ts + const requireContext = require.context( + `./{new-language-directory}`, + false, + /\.ts$/ + ); + ``` + +3. **Translate Each Attribute Value** + + - Open the `.ts` file in the **new directory**. + - Translate the value of each key into your target language. + +4. **Finalize the Configuration** + - Review and ensure all translations are complete. + - Your new language configuration is now ready for use! diff --git a/src/pages/llmodels/components/advance-config.tsx b/src/pages/llmodels/components/advance-config.tsx index 865bbf8b..d48f2f4c 100644 --- a/src/pages/llmodels/components/advance-config.tsx +++ b/src/pages/llmodels/components/advance-config.tsx @@ -278,7 +278,7 @@ const AdvanceConfig: React.FC = (props) => { { label: 'vox-box', value: backendOptionsMap.voxBox, - disabled: false + disabled: source === modelSourceMap.ollama_library_value } ]} disabled={ diff --git a/src/pages/playground/config/params-config.ts b/src/pages/playground/config/params-config.ts index 0b330bee..e1da21dc 100644 --- a/src/pages/playground/config/params-config.ts +++ b/src/pages/playground/config/params-config.ts @@ -113,8 +113,8 @@ export const ImageParamsConfig: ParamsSchema[] = [ name: 'size', options: [ { label: 'playground.params.custom', value: 'custom', locale: true }, - { label: '256x256', value: '256x256' }, { label: '512x512', value: '512x512' }, + { label: '768x1024', value: '768x1024' }, { label: '1024x1024', value: '1024x1024' } ], description: { From 5fd4b55127b05176c371ce4b81f7cbe7aad5c3f9 Mon Sep 17 00:00:00 2001 From: jialin Date: Thu, 12 Dec 2024 14:11:33 +0800 Subject: [PATCH 2/2] fix: do not collapse other models, after creating a new --- src/pages/llmodels/components/table-list.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/llmodels/components/table-list.tsx b/src/pages/llmodels/components/table-list.tsx index 278949eb..725aba90 100644 --- a/src/pages/llmodels/components/table-list.tsx +++ b/src/pages/llmodels/components/table-list.tsx @@ -323,13 +323,12 @@ const Models: React.FC = ({ ..._.omit(data, result.omits) } }); - console.log('modelData:', modelData); setOpenDeployModal({ ...openDeployModal, show: false }); setTimeout(() => { - updateExpandedRowKeys([modelData.id]); + updateExpandedRowKeys([modelData.id, ...expandedRowKeys]); }, 300); message.success(intl.formatMessage({ id: 'common.message.success' })); } catch (error) {}