This commit is contained in:
Timothy J. Baek 2024-05-25 00:44:21 -07:00
parent fad07d2049
commit 1aa33a4667
6 changed files with 9 additions and 18 deletions

View File

@ -283,7 +283,7 @@ export interface ModelConfig {
export interface ModelMeta {
description?: string;
vision_capable?: boolean;
capabilities?: object;
}
export interface ModelParams {}

View File

@ -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>

View File

@ -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;

View File

@ -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}

View File

@ -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>

View File

@ -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>