Skip to content

Commit

Permalink
fix: should stop running the model when GPU settings are changed (jan…
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan authored Feb 18, 2024
1 parent a3aceb8 commit 56034d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/screens/Settings/Advanced/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { snackbar, toaster } from '@/containers/Toast'

import { FeatureToggleContext } from '@/context/FeatureToggle'

import { useActiveModel } from '@/hooks/useActiveModel'
import { useSettings } from '@/hooks/useSettings'

import DataFolder from './DataFolder'
Expand All @@ -62,6 +63,7 @@ const Advanced = () => {
const [gpusInUse, setGpusInUse] = useState<string[]>([])
const { readSettings, saveSettings, validateSettings, setShowNotification } =
useSettings()
const { stopModel } = useActiveModel()

const selectedGpu = gpuList
.filter((x) => gpusInUse.includes(x.id))
Expand Down Expand Up @@ -232,6 +234,8 @@ const Advanced = () => {
type: 'success',
})
}
// Stop any running model to apply the changes
if (e !== gpuEnabled) stopModel()
}}
/>
</TooltipTrigger>
Expand Down

0 comments on commit 56034d6

Please sign in to comment.