diff --git a/src/App.tsx b/src/App.tsx index dcf4aadf..b9985877 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -45,6 +45,8 @@ function App() { // migration from broken 2.1.0 release if ( + modelDefs.length >= 2 && + modelDefs[1].model && modelDefs[1].model === 'gpt-4-turbo-preview' && modelDefs[1].model_max_tokens == 128000 ) { diff --git a/src/components/ConfigMenu/ModelSelect.tsx b/src/components/ConfigMenu/ModelSelect.tsx index fd72e456..f5fe4812 100644 --- a/src/components/ConfigMenu/ModelSelect.tsx +++ b/src/components/ConfigMenu/ModelSelect.tsx @@ -13,10 +13,14 @@ export const ModelSelect = ({ _setModel: React.Dispatch>; showHidden: boolean; }) => { - const model = _model || 0; + let model = _model || 0; const [dropDown, setDropDown, dropDownRef] = useHideOnOutsideClick(); const modelDefs = useStore((state: StoreState) => state.modelDefs); + if (model >= modelDefs.length) { + model = 0; + } + if (typeof _model !== 'number') { _setModel(0); } @@ -29,7 +33,7 @@ export const ModelSelect = ({ onClick={() => setDropDown((prev) => !prev)} aria-label='model' > - {modelDefs[model]?.name || modelDefs[model].model} + {modelDefs[model]?.name || modelDefs[model]?.model}
lamejs'], }, + build: { sourcemap: 'inline' }, });