From 96d7a993120d54f7d7c85528bbae6eacc6c82e10 Mon Sep 17 00:00:00 2001 From: JustSong Date: Sun, 24 Mar 2024 23:12:32 +0800 Subject: [PATCH] fix: fix autofilled models are not correct --- web/default/src/pages/Channel/EditChannel.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web/default/src/pages/Channel/EditChannel.js b/web/default/src/pages/Channel/EditChannel.js index 330b8c8ef4..203cd71405 100644 --- a/web/default/src/pages/Channel/EditChannel.js +++ b/web/default/src/pages/Channel/EditChannel.js @@ -83,6 +83,7 @@ const EditChannel = () => { data.model_mapping = JSON.stringify(JSON.parse(data.model_mapping), null, 2); } setInputs(data); + setBasicModels(getChannelModels(data.type)); } else { showError(message); } @@ -99,9 +100,6 @@ const EditChannel = () => { })); setOriginModelOptions(localModelOptions); setFullModels(res.data.data.map((model) => model.id)); - setBasicModels(res.data.data.filter((model) => { - return model.id.startsWith('gpt-3') || model.id.startsWith('text-'); - }).map((model) => model.id)); } catch (error) { showError(error.message); } @@ -137,6 +135,9 @@ const EditChannel = () => { useEffect(() => { if (isEdit) { loadChannel().then(); + } else { + let localModels = getChannelModels(inputs.type); + setBasicModels(localModels); } fetchModels().then(); fetchGroups().then(); @@ -355,7 +356,7 @@ const EditChannel = () => {
+ }}>填入相关模型