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
50089710
Commit
50089710
authored
Mar 29, 2024
by
Ased Mammad
Browse files
fix: Add new model selector to playground
parent
c42cb438
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
21 deletions
+19
-21
src/routes/(app)/playground/+page.svelte
src/routes/(app)/playground/+page.svelte
+19
-21
No files found.
src/routes/(app)/playground/+page.svelte
View file @
50089710
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
import { splitStream } from '$lib/utils';
import { splitStream } from '$lib/utils';
import ChatCompletion from '$lib/components/playground/ChatCompletion.svelte';
import ChatCompletion from '$lib/components/playground/ChatCompletion.svelte';
import Selector from '$lib/components/chat/ModelSelector/Selector.svelte';
const i18n = getContext('i18n');
const i18n = getContext('i18n');
...
@@ -315,27 +316,24 @@
...
@@ -315,27 +316,24 @@
</div>
</div>
</div>
</div>
<div class=" flex gap-1 px-1">
<div class="flex flex-col gap-1 px-1 my-2 w-full">
<select
<div class="flex w-full">
id="models"
<div class="overflow-hidden w-full">
class="outline-none bg-transparent text-sm font-medium rounded-lg w-full placeholder-gray-400"
<div class="mr-2 max-w-full">
bind:value={selectedModelId}
<Selector
>
placeholder={$i18n.t('Select a model')}
<option class=" text-gray-800" value="" selected disabled
items={$models
>{$i18n.t('Select a model')}</option
.filter((model) => model.name !== 'hr')
>
.map((model) => ({
value: model.id,
{#each $models as model}
label: model.name,
{#if model.name === 'hr'}
info: model
<hr />
}))}
{:else}
bind:value={selectedModelId}
<option value={model.id} class="text-gray-800 text-lg"
/>
>{model.name +
</div>
`${model.size ? ` (${(model.size / 1024 ** 3).toFixed(1)}GB)` : ''}`}</option
</div>
>
</div>
{/if}
{/each}
</select>
<!-- <button
<!-- <button
class=" self-center dark:hover:text-gray-300"
class=" self-center dark:hover:text-gray-300"
...
...
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