Skip to content

Commit

Permalink
Merge pull request #117 from jackschedel/2.1.0
Browse files Browse the repository at this point in the history
error fixup + sourcemaps
  • Loading branch information
jackschedel authored Feb 13, 2024
2 parents cfd6f60 + 571029d commit 0cbb4ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
Expand Down
8 changes: 6 additions & 2 deletions src/components/ConfigMenu/ModelSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ export const ModelSelect = ({
_setModel: React.Dispatch<React.SetStateAction<number>>;
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);
}
Expand All @@ -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}
<DownChevronArrow />
</button>
<div
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ export default defineConfig({
optimizeDeps: {
include: ['@chengsokdara/use-whisper > lamejs'],
},
build: { sourcemap: 'inline' },
});

0 comments on commit 0cbb4ad

Please sign in to comment.