Skip to content

Commit

Permalink
fix in course model if the default not among allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
mluukkai committed Sep 25, 2024
1 parent d354fe1 commit 8d952f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/client/components/Chat/Status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,9 @@ const ModelSelector = ({
)
}

console.log('model', currentModel)
console.log('models', models)

return (
<Box mb={2}>
<FormControl sx={{ width: '200px' }}>
<span style={{ color: 'white' }}>{currentModel}</span>
<InputLabel>{t('status:modelInUse')}</InputLabel>
<Select
label={t('status:modelInUse')}
Expand Down
4 changes: 4 additions & 0 deletions src/client/components/Chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ const Chat = () => {

const { usage, limit, models: courseModels } = userStatus

if (course && !courseModels.includes(model)) {
setModel(courseModels[0])
}

const tokensUsed = usage >= limit

if (tokensUsed && model !== FREE_MODEL) {
Expand Down

0 comments on commit 8d952f2

Please sign in to comment.