mirror of
https://github.com/open-webui/open-webui.git
synced 2026-01-02 22:55:20 +00:00
Update Chat.svelte (#20256)
This commit is contained in:
parent
214dd50ce9
commit
95ce70c4fd
1 changed files with 2 additions and 1 deletions
|
|
@ -1731,13 +1731,14 @@
|
||||||
|
|
||||||
if (model) {
|
if (model) {
|
||||||
// If there are image files, check if model is vision capable
|
// If there are image files, check if model is vision capable
|
||||||
|
// Skip this check if image generation is enabled, as images may be for editing or are generated outputs in the history
|
||||||
const hasImages = createMessagesList(_history, parentId).some((message) =>
|
const hasImages = createMessagesList(_history, parentId).some((message) =>
|
||||||
message.files?.some(
|
message.files?.some(
|
||||||
(file) => file.type === 'image' || file?.content_type?.startsWith('image/')
|
(file) => file.type === 'image' || file?.content_type?.startsWith('image/')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (hasImages && !(model.info?.meta?.capabilities?.vision ?? true)) {
|
if (hasImages && !(model.info?.meta?.capabilities?.vision ?? true) && !imageGenerationEnabled) {
|
||||||
toast.error(
|
toast.error(
|
||||||
$i18n.t('Model {{modelName}} is not vision capable', {
|
$i18n.t('Model {{modelName}} is not vision capable', {
|
||||||
modelName: model.name ?? model.id
|
modelName: model.name ?? model.id
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue