Skip to content

Commit d7cf258

Browse files
committed
fix: tool indicator in hub
1 parent 0dc0a9a commit d7cf258

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

web-app/src/routes/hub/index.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ import { useModelProvider } from '@/hooks/useModelProvider'
1717
import { Card, CardItem } from '@/containers/Card'
1818
import { RenderMarkdown } from '@/containers/RenderMarkdown'
1919
import { extractModelName, extractDescription } from '@/lib/models'
20-
import { IconDownload, IconFileCode, IconSearch } from '@tabler/icons-react'
20+
import {
21+
IconDownload,
22+
IconFileCode,
23+
IconSearch,
24+
IconTool,
25+
} from '@tabler/icons-react'
2126
import { Switch } from '@/components/ui/switch'
2227
import Joyride, { CallBackProps, STATUS } from 'react-joyride'
2328
import { CustomTooltipJoyRide } from '@/containers/CustomeTooltipJoyRide'
@@ -133,7 +138,10 @@ function Hub() {
133138
if (debouncedSearchValue.length) {
134139
const fuse = new Fuse(filtered, searchOptions)
135140
// Remove domain from search value (e.g., "huggingface.co/author/model" -> "author/model")
136-
const cleanedSearchValue = debouncedSearchValue.replace(/^https?:\/\/[^/]+\//, '')
141+
const cleanedSearchValue = debouncedSearchValue.replace(
142+
/^https?:\/\/[^/]+\//,
143+
''
144+
)
137145
filtered = fuse.search(cleanedSearchValue).map((result) => result.item)
138146
}
139147
// Apply downloaded filter
@@ -647,6 +655,15 @@ function Hub() {
647655
?.length || 0}
648656
</span>
649657
</div>
658+
{filteredModels[virtualItem.index].tools && (
659+
<div className="flex items-center gap-1">
660+
<IconTool
661+
size={17}
662+
className="text-main-view-fg/50"
663+
title={t('hub:tools')}
664+
/>
665+
</div>
666+
)}
650667
{filteredModels[virtualItem.index].quants.length >
651668
1 && (
652669
<div className="flex items-center gap-2 hub-show-variants-step">

web-app/src/services/models.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export interface CatalogModel {
2929
mmproj_models?: MMProjModel[]
3030
created_at?: string
3131
readme?: string
32+
tools?: boolean
3233
}
3334

3435
export type ModelCatalog = CatalogModel[]

0 commit comments

Comments
 (0)