Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
331941db
Commit
331941db
authored
May 25, 2024
by
Timothy J. Baek
Browse files
feat: show desc in model selector
parent
1fb4c602
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
40 deletions
+29
-40
src/lib/components/chat/Messages/Placeholder.svelte
src/lib/components/chat/Messages/Placeholder.svelte
+1
-1
src/lib/components/chat/ModelSelector/Selector.svelte
src/lib/components/chat/ModelSelector/Selector.svelte
+28
-39
No files found.
src/lib/components/chat/Messages/Placeholder.svelte
View file @
331941db
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
<div in:fade={{ duration: 200, delay: 200 }}>
<div in:fade={{ duration: 200, delay: 200 }}>
{#if models[selectedModelIdx]?.info}
{#if models[selectedModelIdx]?.info}
<div class="mt-0.5 text-base font-normal text-gray-500 dark:text-gray-400">
<div class="mt-0.5 text-base font-normal text-gray-500 dark:text-gray-400
line-clamp-3
">
{models[selectedModelIdx]?.info?.meta?.description}
{models[selectedModelIdx]?.info?.meta?.description}
</div>
</div>
{#if models[selectedModelIdx]?.info?.meta?.user}
{#if models[selectedModelIdx]?.info?.meta?.user}
...
...
src/lib/components/chat/ModelSelector/Selector.svelte
View file @
331941db
...
@@ -246,13 +246,29 @@
...
@@ -246,13 +246,29 @@
}}
}}
>
>
<div class="flex items-center gap-2">
<div class="flex items-center gap-2">
<div class="line-clamp-1">
<div class="flex items-center">
{item.label}
<div class="line-clamp-1">
{item.label}
{#if item.model.owned_by === 'ollama'}
</div>
<span class=" text-xs font-medium text-gray-600 dark:text-gray-400"
{#if item.model.owned_by === 'ollama' && (item.model.ollama?.details?.parameter_size ?? '') !== ''}
>{item.model.ollama?.details?.parameter_size ?? ''}</span
<div class="flex ml-1 items-center">
>
<Tooltip
content={`${
item.model.ollama?.details?.quantization_level
? item.model.ollama?.details?.quantization_level + ' '
: ''
}${
item.model.ollama?.size
? `(${(item.model.ollama?.size / 1024 ** 3).toFixed(1)}GB)`
: ''
}`}
className="self-end"
>
<span class=" text-xs font-medium text-gray-600 dark:text-gray-400"
>{item.model.ollama?.details?.parameter_size ?? ''}</span
>
</Tooltip>
</div>
{/if}
{/if}
</div>
</div>
...
@@ -280,40 +296,12 @@
...
@@ -280,40 +296,12 @@
</svg>
</svg>
</div>
</div>
</Tooltip>
</Tooltip>
{:else if item.model.owned_by === 'ollama'}
<Tooltip
content={`${
item.model.ollama?.details?.quantization_level
? item.model.ollama?.details?.quantization_level + ' '
: ''
}${
item.model.ollama?.size
? `(${(item.model.ollama?.size / 1024 ** 3).toFixed(1)}GB)`
: ''
}`}
>
<div class="">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="w-4 h-4"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"
/>
</svg>
</div>
</Tooltip>
{/if}
{/if}
{#if item.info?.custom_info?.meta.description}
{#if item.model?.info?.meta?.description}
<Tooltip
<Tooltip
content={`${sanitizeResponseContent(
content={`${sanitizeResponseContent(
item.
info.custom_
info?.meta.description
item.
model?.
info?.meta
?
.description
).replaceAll('\n', '<br>')}`}
).replaceAll('\n', '<br>')}`}
>
>
<div class="">
<div class="">
...
@@ -328,13 +316,14 @@
...
@@ -328,13 +316,14 @@
<path
<path
stroke-linecap="round"
stroke-linecap="round"
stroke-linejoin="round"
stroke-linejoin="round"
d="
M9.879 7.519c1.171-
1.
0
25
3
.0
7
1-
1
.02
5 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75
M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9
5.2
5h.008v.008H12
v-.008
Z"
d="
m11.25 1
1.25.0
4
1-.02
a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021
M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9
-3.7
5h.008v.008H12
V8.25
Z"
/>
/>
</svg>
</svg>
</div>
</div>
</Tooltip>
</Tooltip>
{/if}
{/if}
</div>
</div>
{#if value === item.value}
{#if value === item.value}
<div class="ml-auto">
<div class="ml-auto">
<Check />
<Check />
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment