Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix: tool indicator in hub

Louisd7cf258a40da
diff --git a/web-app/src/routes/hub/index.tsx b/web-app/src/routes/hub/index.tsx
index 3bf146d87..c58fa3169 100644
--- a/web-app/src/routes/hub/index.tsx
+++ b/web-app/src/routes/hub/index.tsx
@@ -17,7 +17,12 @@ import { useModelProvider } from '@/hooks/useModelProvider'
import { Card, CardItem } from '@/containers/Card'
import { RenderMarkdown } from '@/containers/RenderMarkdown'
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 Joyride, { CallBackProps, STATUS } from 'react-joyride'
import { CustomTooltipJoyRide } from '@/containers/CustomeTooltipJoyRide'
@@ -133,7 +138,10 @@ function Hub() {
if (debouncedSearchValue.length) {
const fuse = new Fuse(filtered, searchOptions)
// 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)
}
// Apply downloaded filter
@@ -647,6 +655,15 @@ function Hub() {
?.length || 0}
</span>
</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 >
1 && (
<div className="flex items-center gap-2 hub-show-variants-step">
diff --git a/web-app/src/services/models.ts b/web-app/src/services/models.ts
index bad811290..6f0bda5f9 100644
--- a/web-app/src/services/models.ts
+++ b/web-app/src/services/models.ts
@@ -29,6 +29,7 @@ export interface CatalogModel {
mmproj_models?: MMProjModel[]
created_at?: string
readme?: string
+ tools?: boolean
}
export type ModelCatalog = CatalogModel[]