Skip to content

Commit 6f3921f

Browse files
committed
fix: add HuggingFace case to useSelectedModel hook
1 parent 8a787d2 commit 6f3921f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

webview-ui/src/components/ui/hooks/useSelectedModel.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ import {
3434
litellmDefaultModelId,
3535
claudeCodeDefaultModelId,
3636
claudeCodeModels,
37+
huggingFaceDefaultModelId,
38+
huggingFaceModels,
3739
} from "@roo-code/types"
3840

3941
import type { RouterModels } from "@roo/api"
@@ -214,11 +216,16 @@ function getSelectedModel({
214216
const info = claudeCodeModels[id as keyof typeof claudeCodeModels]
215217
return { id, info: { ...openAiModelInfoSaneDefaults, ...info } }
216218
}
219+
case "huggingface": {
220+
const id = apiConfiguration.huggingFaceModelId ?? huggingFaceDefaultModelId
221+
const info = huggingFaceModels[id as keyof typeof huggingFaceModels]
222+
return { id, info: info || openAiModelInfoSaneDefaults }
223+
}
217224
// case "anthropic":
218225
// case "human-relay":
219226
// case "fake-ai":
220227
default: {
221-
provider satisfies "anthropic" | "gemini-cli" | "human-relay" | "fake-ai"
228+
provider satisfies "anthropic" | "gemini-cli" | "human-relay" | "fake-ai" | "huggingface"
222229
const id = apiConfiguration.apiModelId ?? anthropicDefaultModelId
223230
const info = anthropicModels[id as keyof typeof anthropicModels]
224231
return { id, info }

0 commit comments

Comments
 (0)