"...git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "0a3cc459d497ed838455c4954472dbdde32939b0"
Commit 1aa33a46 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

refac

parent fad07d20
...@@ -283,7 +283,7 @@ export interface ModelConfig { ...@@ -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 {}
......
...@@ -125,7 +125,7 @@ ...@@ -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>
......
...@@ -327,10 +327,10 @@ ...@@ -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 @@ ...@@ -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;
......
...@@ -298,10 +298,7 @@ ...@@ -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 @@ ...@@ -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}
......
...@@ -646,10 +646,7 @@ ...@@ -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>
......
...@@ -323,10 +323,7 @@ ...@@ -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>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment