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 { export interface ModelMeta {
description?: string; description?: string;
vision_capable?: boolean; capabilities?: object;
} }
export interface ModelParams {} export interface ModelParams {}

View File

@ -125,7 +125,7 @@
<option value="" disabled selected>{$i18n.t('Select a model')}</option> <option value="" disabled selected>{$i18n.t('Select a model')}</option>
{#each $models.filter((model) => model.id) as model} {#each $models.filter((model) => model.id) as model}
<option value={model.id} class="bg-gray-100 dark:bg-gray-700" <option value={model.id} class="bg-gray-100 dark:bg-gray-700"
>{model.custom_info?.name ?? model.name}</option >{model.name}</option
> >
{/each} {/each}
</select> </select>

View File

@ -327,10 +327,10 @@
message.files?.some((file) => file.type === 'image') 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( toast.error(
$i18n.t('Model {{modelName}} is not vision capable', { $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.error = true;
responseMessage.content = responseMessage.content =
$i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, { $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' + '\n' +
errorMessage; errorMessage;

View File

@ -298,10 +298,7 @@
{#each $models as model} {#each $models as model}
{#if model.size != null} {#if model.size != null}
<option value={model.name} class="bg-gray-100 dark:bg-gray-700"> <option value={model.name} class="bg-gray-100 dark:bg-gray-700">
{(model.custom_info?.name ?? model.name) + {model.name + ' (' + (model.size / 1024 ** 3).toFixed(1) + ' GB)'}
' (' +
(model.size / 1024 ** 3).toFixed(1) +
' GB)'}
</option> </option>
{/if} {/if}
{/each} {/each}
@ -319,7 +316,7 @@
{#each $models as model} {#each $models as model}
{#if model.name !== 'hr'} {#if model.name !== 'hr'}
<option value={model.name} class="bg-gray-100 dark:bg-gray-700"> <option value={model.name} class="bg-gray-100 dark:bg-gray-700">
{model.custom_info?.name ?? model.name} {model.name}
</option> </option>
{/if} {/if}
{/each} {/each}

View File

@ -646,10 +646,7 @@
{/if} {/if}
{#each $models.filter((m) => m.size != null && (selectedOllamaUrlIdx === null ? true : (m?.urls ?? []).includes(selectedOllamaUrlIdx))) as model} {#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" <option value={model.name} class="bg-gray-100 dark:bg-gray-700"
>{(model.custom_info?.name ?? model.name) + >{model.name + ' (' + (model.size / 1024 ** 3).toFixed(1) + ' GB)'}</option
' (' +
(model.size / 1024 ** 3).toFixed(1) +
' GB)'}</option
> >
{/each} {/each}
</select> </select>

View File

@ -323,10 +323,7 @@
{/if} {/if}
{#each $models.filter((m) => m.id && !m.external) as model} {#each $models.filter((m) => m.id && !m.external) as model}
<option value={model.name} class="bg-gray-100 dark:bg-gray-700" <option value={model.name} class="bg-gray-100 dark:bg-gray-700"
>{(model.custom_info?.name ?? model.name) + >{model.name + ' (' + (model.size / 1024 ** 3).toFixed(1) + ' GB)'}</option
' (' +
(model.size / 1024 ** 3).toFixed(1) +
' GB)'}</option
> >
{/each} {/each}
</select> </select>