fix: tool indicator in hub
This commit is contained in:
parent
0dc0a9a4a3
commit
d7cf258a40
@ -17,7 +17,12 @@ import { useModelProvider } from '@/hooks/useModelProvider'
|
|||||||
import { Card, CardItem } from '@/containers/Card'
|
import { Card, CardItem } from '@/containers/Card'
|
||||||
import { RenderMarkdown } from '@/containers/RenderMarkdown'
|
import { RenderMarkdown } from '@/containers/RenderMarkdown'
|
||||||
import { extractModelName, extractDescription } from '@/lib/models'
|
import { extractModelName, extractDescription } from '@/lib/models'
|
||||||
import { IconDownload, IconFileCode, IconSearch } from '@tabler/icons-react'
|
import {
|
||||||
|
IconDownload,
|
||||||
|
IconFileCode,
|
||||||
|
IconSearch,
|
||||||
|
IconTool,
|
||||||
|
} from '@tabler/icons-react'
|
||||||
import { Switch } from '@/components/ui/switch'
|
import { Switch } from '@/components/ui/switch'
|
||||||
import Joyride, { CallBackProps, STATUS } from 'react-joyride'
|
import Joyride, { CallBackProps, STATUS } from 'react-joyride'
|
||||||
import { CustomTooltipJoyRide } from '@/containers/CustomeTooltipJoyRide'
|
import { CustomTooltipJoyRide } from '@/containers/CustomeTooltipJoyRide'
|
||||||
@ -133,7 +138,10 @@ function Hub() {
|
|||||||
if (debouncedSearchValue.length) {
|
if (debouncedSearchValue.length) {
|
||||||
const fuse = new Fuse(filtered, searchOptions)
|
const fuse = new Fuse(filtered, searchOptions)
|
||||||
// Remove domain from search value (e.g., "huggingface.co/author/model" -> "author/model")
|
// Remove domain from search value (e.g., "huggingface.co/author/model" -> "author/model")
|
||||||
const cleanedSearchValue = debouncedSearchValue.replace(/^https?:\/\/[^/]+\//, '')
|
const cleanedSearchValue = debouncedSearchValue.replace(
|
||||||
|
/^https?:\/\/[^/]+\//,
|
||||||
|
''
|
||||||
|
)
|
||||||
filtered = fuse.search(cleanedSearchValue).map((result) => result.item)
|
filtered = fuse.search(cleanedSearchValue).map((result) => result.item)
|
||||||
}
|
}
|
||||||
// Apply downloaded filter
|
// Apply downloaded filter
|
||||||
@ -647,6 +655,15 @@ function Hub() {
|
|||||||
?.length || 0}
|
?.length || 0}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
{filteredModels[virtualItem.index].tools && (
|
||||||
|
<div className="flex items-center gap-1">
|
||||||
|
<IconTool
|
||||||
|
size={17}
|
||||||
|
className="text-main-view-fg/50"
|
||||||
|
title={t('hub:tools')}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{filteredModels[virtualItem.index].quants.length >
|
{filteredModels[virtualItem.index].quants.length >
|
||||||
1 && (
|
1 && (
|
||||||
<div className="flex items-center gap-2 hub-show-variants-step">
|
<div className="flex items-center gap-2 hub-show-variants-step">
|
||||||
|
|||||||
@ -29,6 +29,7 @@ export interface CatalogModel {
|
|||||||
mmproj_models?: MMProjModel[]
|
mmproj_models?: MMProjModel[]
|
||||||
created_at?: string
|
created_at?: string
|
||||||
readme?: string
|
readme?: string
|
||||||
|
tools?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ModelCatalog = CatalogModel[]
|
export type ModelCatalog = CatalogModel[]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user