Skip to content

Commit 45ba949

Browse files
committed
fix: toggle vision for remote model
1 parent 63acb3a commit 45ba949

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

web-app/src/containers/ChatInput.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,15 @@ const ChatInput = ({ model, className, initialMessage }: ChatInputProps) => {
107107
if (selectedProvider === 'llamacpp') {
108108
const hasLocalMmproj = await checkMmprojExists(selectedModel.id)
109109
setHasMmproj(hasLocalMmproj)
110-
} else {
111-
// For non-llamacpp providers, only check vision capability
110+
}
111+
// For non-llamacpp providers, only check vision capability
112+
else if (
113+
selectedProvider !== 'llamacpp' &&
114+
selectedModel?.capabilities?.includes('vision')
115+
) {
112116
setHasMmproj(true)
117+
} else {
118+
setHasMmproj(false)
113119
}
114120
} catch (error) {
115121
console.error('Error checking mmproj:', error)
@@ -119,7 +125,7 @@ const ChatInput = ({ model, className, initialMessage }: ChatInputProps) => {
119125
}
120126

121127
checkMmprojSupport()
122-
}, [selectedModel?.id, selectedProvider])
128+
}, [selectedModel?.capabilities, selectedModel?.id, selectedProvider])
123129

124130
// Check if there are active MCP servers
125131
const hasActiveMCPServers = connectedServers.length > 0 || tools.length > 0

web-app/src/containers/dialogs/EditModel.tsx

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -177,21 +177,13 @@ export const DialogEditModel = ({
177177
{t('providers:editModel.vision')}
178178
</span>
179179
</div>
180-
<Tooltip>
181-
<TooltipTrigger>
182-
<Switch
183-
id="vision-capability"
184-
checked={capabilities.vision}
185-
disabled={true}
186-
onCheckedChange={(checked) =>
187-
handleCapabilityChange('vision', checked)
188-
}
189-
/>
190-
</TooltipTrigger>
191-
<TooltipContent>
192-
{t('providers:editModel.notAvailable')}
193-
</TooltipContent>
194-
</Tooltip>
180+
<Switch
181+
id="vision-capability"
182+
checked={capabilities.vision}
183+
onCheckedChange={(checked) =>
184+
handleCapabilityChange('vision', checked)
185+
}
186+
/>
195187
</div>
196188

197189
<div className="flex items-center justify-between">

0 commit comments

Comments
 (0)