Skip to content

Commit

Permalink
added calculation active model size into available RAM
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Jan 10, 2024
1 parent aca6fee commit 487f4f7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/screens/ExploreModels/ExploreModelItemHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import ModalCancelDownload from '@/containers/ModalCancelDownload'

import { MainViewState } from '@/constants/screens'

import { useActiveModel } from '@/hooks/useActiveModel'
import { useCreateNewThread } from '@/hooks/useCreateNewThread'
import useDownloadModel from '@/hooks/useDownloadModel'
import { useDownloadState } from '@/hooks/useDownloadState'
Expand Down Expand Up @@ -83,9 +84,11 @@ const ExploreModelItemHeader: React.FC<Props> = ({ model, onClick, open }) => {
downloadButton = <ModalCancelDownload model={model} />
}

const { activeModel } = useActiveModel()

const getLabel = (size: number) => {
const minimumRamModel = size * 1.25
const availableRam = totalRam - usedRam
const availableRam = totalRam - usedRam + (activeModel?.metadata.size ?? 0)

if (minimumRamModel > totalRam) {
return (
Expand Down

0 comments on commit 487f4f7

Please sign in to comment.