fix: ensure custom params are not passed to non custom models

This commit is contained in:
Daniel Avila 2023-03-14 20:21:41 -04:00
parent 6e32f71565
commit 796d8031e8
10 changed files with 503 additions and 151 deletions

View file

@ -46,7 +46,10 @@ export default function ModelMenu() {
mutate();
try {
const lastSelected = JSON.parse(localStorage.getItem('model'));
if (lastSelected && lastSelected !== 'chatgptCustom' && initial[lastSelected]) {
if (lastSelected === 'chatgptCustom') {
return;
} else if (initial[lastSelected]) {
dispatch(setModel(lastSelected));
}
} catch (err) {
@ -72,6 +75,7 @@ export default function ModelMenu() {
dispatch(setModel(value));
dispatch(setDisabled(false));
dispatch(setCustomModel(null));
dispatch(setCustomGpt({ chatGptLabel: null, promptPrefix: null }));
} else if (!initial[value]) {
const chatGptLabel = modelMap[value]?.chatGptLabel;
const promptPrefix = modelMap[value]?.promptPrefix;