diff --git a/web/containers/ModelDropdown/index.tsx b/web/containers/ModelDropdown/index.tsx index b0fed7e66f..ed7eed635f 100644 --- a/web/containers/ModelDropdown/index.tsx +++ b/web/containers/ModelDropdown/index.tsx @@ -83,7 +83,7 @@ const ModelDropdown = ({ const filteredDownloadedModels = useMemo( () => - downloadedModels + configuredModels .filter((e) => e.name.toLowerCase().includes(searchText.toLowerCase().trim()) ) @@ -105,7 +105,7 @@ const ModelDropdown = ({ } }) .sort((a, b) => a.name.localeCompare(b.name)), - [downloadedModels, searchText, searchFilter] + [configuredModels, searchText, searchFilter] ) useEffect(() => { @@ -290,58 +290,58 @@ const ModelDropdown = ({ - {filteredDownloadedModels.filter( - (x) => x.engine === InferenceEngine.nitro - ).length !== 0 ? ( + {searchFilter !== 'remote' && (
Cortex
+
+ {filteredDownloadedModels + .filter((x) => { + if (searchText.length === 0) { + return downloadedModels.find((c) => c.id === x.id) + } else { + return x + } + }) + .filter((x) => x.engine === InferenceEngine.nitro).length !== + 0 ? ( -
- - ) : ( - <> - {searchFilter !== 'remote' && ( -
-
-
- Cortex -
- {searchText.length === 0 ? ( -
    - {featuredModel.map((model) => { + .map((model) => { const isDownloading = downloadingModels.some( (md) => md.id === model.id ) + const isdDownloaded = downloadedModels.some( + (c) => c.id === model.id + ) return (
  • { + if (isdDownloaded) { + onClickModelItem(model.id) + } + }} >

    {model.name} @@ -352,10 +352,12 @@ const ModelDropdown = ({ />

    - - {toGibibytes(model.metadata.size)} - - {!isDownloading ? ( + {!isdDownloaded && ( + + {toGibibytes(model.metadata.size)} + + )} + {!isDownloading && !isdDownloaded ? (
  • ) - })} -
- ) : ( -
    - {configuredModels - .filter((x) => x.engine === InferenceEngine.nitro) - .filter((e) => - e.name - .toLowerCase() - .includes(searchText.toLowerCase().trim()) - ) - .map((model) => { - const isDownloading = downloadingModels.some( - (md) => md.id === model.id - ) - return ( -
  • -
    -

    - {model.name} -

    - -
    -
    - - {toGibibytes(model.metadata.size)} - - {!isDownloading ? ( - downloadModel(model)} - /> - ) : ( - Object.values(downloadStates) - .filter((x) => x.modelId === model.id) - .map((item) => ( - - )) - )} -
    -
  • - ) - })} -
- )} -
-
+ }) + : null} + + ) : ( + )} - + )} {groupByEngine.map((engine, i) => {