Skip to content

Commit

Permalink
fix: fix autofilled models are not correct
Browse files Browse the repository at this point in the history
  • Loading branch information
songquanpeng committed Mar 24, 2024
1 parent 24be9de commit 96d7a99
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions web/default/src/pages/Channel/EditChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down Expand Up @@ -137,6 +135,9 @@ const EditChannel = () => {
useEffect(() => {
if (isEdit) {
loadChannel().then();
} else {
let localModels = getChannelModels(inputs.type);
setBasicModels(localModels);
}
fetchModels().then();
fetchGroups().then();
Expand Down Expand Up @@ -355,7 +356,7 @@ const EditChannel = () => {
<div style={{ lineHeight: '40px', marginBottom: '12px' }}>
<Button type={'button'} onClick={() => {
handleInputChange(null, { name: 'models', value: basicModels });
}}>填入基础模型</Button>
}}>填入相关模型</Button>
<Button type={'button'} onClick={() => {
handleInputChange(null, { name: 'models', value: fullModels });
}}>填入所有模型</Button>
Expand Down

0 comments on commit 96d7a99

Please sign in to comment.