diff --git a/studio/frontend/src/features/onboarding/components/steps/model-selection-step.tsx b/studio/frontend/src/features/onboarding/components/steps/model-selection-step.tsx index 747311c9a5..5cf4ebc0b5 100644 --- a/studio/frontend/src/features/onboarding/components/steps/model-selection-step.tsx +++ b/studio/frontend/src/features/onboarding/components/steps/model-selection-step.tsx @@ -85,6 +85,7 @@ export function ModelSelectionStep() { } = useHfModelSearch(debouncedQuery, { task, accessToken: hfToken || undefined, + excludeGguf: true, }); const { error: tokenValidationError, isChecking: isCheckingToken } = diff --git a/studio/frontend/src/features/studio/sections/model-section.tsx b/studio/frontend/src/features/studio/sections/model-section.tsx index 5b88664fd1..3d3ede7c1f 100644 --- a/studio/frontend/src/features/studio/sections/model-section.tsx +++ b/studio/frontend/src/features/studio/sections/model-section.tsx @@ -159,6 +159,7 @@ export function ModelSection() { } = useHfModelSearch(debouncedQuery, { task, accessToken: hfToken || undefined, + excludeGguf: true, }); const { error: tokenValidationError, isChecking: isCheckingToken } = diff --git a/studio/frontend/src/hooks/use-hf-model-search.ts b/studio/frontend/src/hooks/use-hf-model-search.ts index 6ba70a4d5c..8fc0b32cf8 100644 --- a/studio/frontend/src/hooks/use-hf-model-search.ts +++ b/studio/frontend/src/hooks/use-hf-model-search.ts @@ -11,7 +11,6 @@ export interface HfModelResult { } const EXCLUDED_TAGS = new Set([ - "gguf", "gptq", "awq", "exl2", @@ -45,22 +44,27 @@ function withPopularitySort( return fetch(url, init); } -function mapModel(raw: unknown): HfModelResult | null { - const m = raw as { - name: string; - downloads: number; - likes: number; - safetensors?: { total: number }; - tags?: string[]; - }; - if (m.tags?.some((t) => EXCLUDED_TAGS.has(t))) { - return null; - } - return { - id: m.name, - downloads: m.downloads, - likes: m.likes, - totalParams: m.safetensors?.total, +function makeMapModel(excludeGguf: boolean) { + return (raw: unknown): HfModelResult | null => { + const m = raw as { + name: string; + downloads: number; + likes: number; + safetensors?: { total: number }; + tags?: string[]; + }; + if (m.tags?.some((t) => EXCLUDED_TAGS.has(t))) { + return null; + } + if (excludeGguf && m.tags?.includes("gguf")) { + return null; + } + return { + id: m.name, + downloads: m.downloads, + likes: m.likes, + totalParams: m.safetensors?.total, + }; }; } @@ -113,9 +117,9 @@ async function* mergedModelIterator( export function useHfModelSearch( query: string, - options?: { task?: PipelineType; accessToken?: string }, + options?: { task?: PipelineType; accessToken?: string; excludeGguf?: boolean }, ) { - const { task, accessToken } = options ?? {}; + const { task, accessToken, excludeGguf = false } = options ?? {}; const createIter = useCallback( () => { @@ -135,6 +139,7 @@ export function useHfModelSearch( [query, task, accessToken], ); + const mapModel = useMemo(() => makeMapModel(excludeGguf), [excludeGguf]); const search = useHfPaginatedSearch(createIter, mapModel); // Secondary sort guarantee: unsloth models always float to the top