mirror of
https://github.com/open-webui/open-webui
synced 2025-04-01 16:13:25 +00:00
refac
This commit is contained in:
parent
fad07d2049
commit
1aa33a4667
@ -283,7 +283,7 @@ export interface ModelConfig {
|
||||
|
||||
export interface ModelMeta {
|
||||
description?: string;
|
||||
vision_capable?: boolean;
|
||||
capabilities?: object;
|
||||
}
|
||||
|
||||
export interface ModelParams {}
|
||||
|
@ -125,7 +125,7 @@
|
||||
<option value="" disabled selected>{$i18n.t('Select a model')}</option>
|
||||
{#each $models.filter((model) => model.id) as model}
|
||||
<option value={model.id} class="bg-gray-100 dark:bg-gray-700"
|
||||
>{model.custom_info?.name ?? model.name}</option
|
||||
>{model.name}</option
|
||||
>
|
||||
{/each}
|
||||
</select>
|
||||
|
@ -327,10 +327,10 @@
|
||||
message.files?.some((file) => file.type === 'image')
|
||||
);
|
||||
|
||||
if (hasImages && !(model.custom_info?.meta.vision_capable ?? true)) {
|
||||
if (hasImages && !(model.info?.meta?.capabilities?.vision ?? true)) {
|
||||
toast.error(
|
||||
$i18n.t('Model {{modelName}} is not vision capable', {
|
||||
modelName: model.custom_info?.name ?? model.name ?? model.id
|
||||
modelName: model.name ?? model.id
|
||||
})
|
||||
);
|
||||
}
|
||||
@ -857,7 +857,7 @@
|
||||
responseMessage.error = true;
|
||||
responseMessage.content =
|
||||
$i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, {
|
||||
provider: model.custom_info?.name ?? model.name ?? model.id
|
||||
provider: model.name ?? model.id
|
||||
}) +
|
||||
'\n' +
|
||||
errorMessage;
|
||||
|
@ -298,10 +298,7 @@
|
||||
{#each $models as model}
|
||||
{#if model.size != null}
|
||||
<option value={model.name} class="bg-gray-100 dark:bg-gray-700">
|
||||
{(model.custom_info?.name ?? model.name) +
|
||||
' (' +
|
||||
(model.size / 1024 ** 3).toFixed(1) +
|
||||
' GB)'}
|
||||
{model.name + ' (' + (model.size / 1024 ** 3).toFixed(1) + ' GB)'}
|
||||
</option>
|
||||
{/if}
|
||||
{/each}
|
||||
@ -319,7 +316,7 @@
|
||||
{#each $models as model}
|
||||
{#if model.name !== 'hr'}
|
||||
<option value={model.name} class="bg-gray-100 dark:bg-gray-700">
|
||||
{model.custom_info?.name ?? model.name}
|
||||
{model.name}
|
||||
</option>
|
||||
{/if}
|
||||
{/each}
|
||||
|
@ -646,10 +646,7 @@
|
||||
{/if}
|
||||
{#each $models.filter((m) => m.size != null && (selectedOllamaUrlIdx === null ? true : (m?.urls ?? []).includes(selectedOllamaUrlIdx))) as model}
|
||||
<option value={model.name} class="bg-gray-100 dark:bg-gray-700"
|
||||
>{(model.custom_info?.name ?? model.name) +
|
||||
' (' +
|
||||
(model.size / 1024 ** 3).toFixed(1) +
|
||||
' GB)'}</option
|
||||
>{model.name + ' (' + (model.size / 1024 ** 3).toFixed(1) + ' GB)'}</option
|
||||
>
|
||||
{/each}
|
||||
</select>
|
||||
|
@ -323,10 +323,7 @@
|
||||
{/if}
|
||||
{#each $models.filter((m) => m.id && !m.external) as model}
|
||||
<option value={model.name} class="bg-gray-100 dark:bg-gray-700"
|
||||
>{(model.custom_info?.name ?? model.name) +
|
||||
' (' +
|
||||
(model.size / 1024 ** 3).toFixed(1) +
|
||||
' GB)'}</option
|
||||
>{model.name + ' (' + (model.size / 1024 ** 3).toFixed(1) + ' GB)'}</option
|
||||
>
|
||||
{/each}
|
||||
</select>
|
||||
|
Loading…
Reference in New Issue
Block a user