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
ca3108a5
"...composable_kernel_onnxruntime.git" did not exist on "ecf337bab5c23708d80a4c537c6b49dbda6e23b2"
Commit
ca3108a5
authored
May 24, 2024
by
Timothy J. Baek
Browse files
refac
parent
e316abcf
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
355 additions
and
170 deletions
+355
-170
backend/apps/web/internal/migrations/010_migrate_modelfiles_to_models.py
...b/internal/migrations/010_migrate_modelfiles_to_models.py
+1
-1
backend/main.py
backend/main.py
+5
-2
src/lib/apis/index.ts
src/lib/apis/index.ts
+17
-1
src/lib/components/chat/Settings/Advanced.svelte
src/lib/components/chat/Settings/Advanced.svelte
+24
-24
src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte
...b/components/chat/Settings/Advanced/AdvancedParams.svelte
+165
-91
src/lib/components/chat/Settings/General.svelte
src/lib/components/chat/Settings/General.svelte
+24
-24
src/routes/(app)/workspace/models/create/+page.svelte
src/routes/(app)/workspace/models/create/+page.svelte
+15
-15
src/routes/(app)/workspace/models/edit/+page.svelte
src/routes/(app)/workspace/models/edit/+page.svelte
+104
-12
No files found.
backend/apps/web/internal/migrations/010_migrate_modelfiles_to_models.py
View file @
ca3108a5
...
@@ -70,7 +70,7 @@ def migrate_modelfile_to_model(migrator: Migrator, database: pw.Database):
...
@@ -70,7 +70,7 @@ def migrate_modelfile_to_model(migrator: Migrator, database: pw.Database):
# Insert the processed data into the 'model' table
# Insert the processed data into the 'model' table
Model
.
create
(
Model
.
create
(
id
=
modelfile
.
tag_name
,
id
=
f
"ollama-
{
modelfile
.
tag_name
}
"
,
user_id
=
modelfile
.
user_id
,
user_id
=
modelfile
.
user_id
,
base_model_id
=
info
.
get
(
"base_model_id"
),
base_model_id
=
info
.
get
(
"base_model_id"
),
name
=
modelfile
.
modelfile
.
get
(
"title"
),
name
=
modelfile
.
modelfile
.
get
(
"title"
),
...
...
backend/main.py
View file @
ca3108a5
...
@@ -314,10 +314,12 @@ async def get_all_models():
...
@@ -314,10 +314,12 @@ async def get_all_models():
model
[
"name"
]
=
custom_model
.
name
model
[
"name"
]
=
custom_model
.
name
model
[
"info"
]
=
custom_model
.
model_dump
()
model
[
"info"
]
=
custom_model
.
model_dump
()
else
:
else
:
owned_by
=
"openai"
owned_by
=
"openai"
for
model
in
models
:
for
model
in
models
:
if
custom_model
.
base_model_id
==
model
[
"id"
]:
if
(
custom_model
.
base_model_id
==
model
[
"id"
]
or
custom_model
.
base_model_id
==
model
[
"id"
].
split
(
":"
)[
0
]
):
owned_by
=
model
[
"owned_by"
]
owned_by
=
model
[
"owned_by"
]
break
break
...
@@ -329,6 +331,7 @@ async def get_all_models():
...
@@ -329,6 +331,7 @@ async def get_all_models():
"created"
:
custom_model
.
created_at
,
"created"
:
custom_model
.
created_at
,
"owned_by"
:
owned_by
,
"owned_by"
:
owned_by
,
"info"
:
custom_model
.
model_dump
(),
"info"
:
custom_model
.
model_dump
(),
"preset"
:
True
,
}
}
)
)
...
...
src/lib/apis/index.ts
View file @
ca3108a5
...
@@ -27,7 +27,23 @@ export const getModels = async (token: string = '') => {
...
@@ -27,7 +27,23 @@ export const getModels = async (token: string = '') => {
let
models
=
res
?.
data
??
[];
let
models
=
res
?.
data
??
[];
models
=
models
.
filter
((
models
)
=>
models
).
sort
((
a
,
b
)
=>
(
a
.
name
>
b
.
name
?
1
:
-
1
));
models
=
models
.
filter
((
models
)
=>
models
)
.
sort
((
a
,
b
)
=>
{
// Compare case-insensitively
const
lowerA
=
a
.
name
.
toLowerCase
();
const
lowerB
=
b
.
name
.
toLowerCase
();
if
(
lowerA
<
lowerB
)
return
-
1
;
if
(
lowerA
>
lowerB
)
return
1
;
// If same case-insensitively, sort by original strings,
// lowercase will come before uppercase due to ASCII values
if
(
a
<
b
)
return
-
1
;
if
(
a
>
b
)
return
1
;
return
0
;
// They are equal
});
console
.
log
(
models
);
console
.
log
(
models
);
return
models
;
return
models
;
...
...
src/lib/components/chat/Settings/Advanced.svelte
View file @
ca3108a5
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
let requestFormat = '';
let requestFormat = '';
let keepAlive = null;
let keepAlive = null;
let
option
s = {
let
param
s = {
// Advanced
// Advanced
seed: 0,
seed: 0,
temperature: '',
temperature: '',
...
@@ -44,14 +44,14 @@
...
@@ -44,14 +44,14 @@
requestFormat = settings.requestFormat ?? '';
requestFormat = settings.requestFormat ?? '';
keepAlive = settings.keepAlive ?? null;
keepAlive = settings.keepAlive ?? null;
option
s.seed = settings.seed ?? 0;
param
s.seed = settings.seed ?? 0;
option
s.temperature = settings.temperature ?? '';
param
s.temperature = settings.temperature ?? '';
option
s.repeat_penalty = settings.repeat_penalty ?? '';
param
s.repeat_penalty = settings.repeat_penalty ?? '';
option
s.top_k = settings.top_k ?? '';
param
s.top_k = settings.top_k ?? '';
option
s.top_p = settings.top_p ?? '';
param
s.top_p = settings.top_p ?? '';
option
s.num_ctx = settings.num_ctx ?? '';
param
s.num_ctx = settings.num_ctx ?? '';
option
s = { ...
option
s, ...settings.
option
s };
param
s = { ...
param
s, ...settings.
param
s };
option
s.stop = (settings?.
option
s?.stop ?? []).join(',');
param
s.stop = (settings?.
param
s?.stop ?? []).join(',');
});
});
</script>
</script>
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
<div class=" space-y-3 pr-1.5 overflow-y-scroll max-h-80">
<div class=" space-y-3 pr-1.5 overflow-y-scroll max-h-80">
<div class=" text-sm font-medium">{$i18n.t('Parameters')}</div>
<div class=" text-sm font-medium">{$i18n.t('Parameters')}</div>
<AdvancedParams bind:
option
s />
<AdvancedParams bind:
param
s />
<hr class=" dark:border-gray-700" />
<hr class=" dark:border-gray-700" />
<div class=" py-1 w-full justify-between">
<div class=" py-1 w-full justify-between">
...
@@ -128,20 +128,20 @@
...
@@ -128,20 +128,20 @@
class=" px-4 py-2 bg-emerald-700 hover:bg-emerald-800 text-gray-100 transition rounded-lg"
class=" px-4 py-2 bg-emerald-700 hover:bg-emerald-800 text-gray-100 transition rounded-lg"
on:click={() => {
on:click={() => {
saveSettings({
saveSettings({
option
s: {
param
s: {
seed: (
option
s.seed !== 0 ?
option
s.seed : undefined) ?? undefined,
seed: (
param
s.seed !== 0 ?
param
s.seed : undefined) ?? undefined,
stop:
option
s.stop !== '' ?
option
s.stop.split(',').filter((e) => e) : undefined,
stop:
param
s.stop !== '' ?
param
s.stop.split(',').filter((e) => e) : undefined,
temperature:
option
s.temperature !== '' ?
option
s.temperature : undefined,
temperature:
param
s.temperature !== '' ?
param
s.temperature : undefined,
repeat_penalty:
option
s.repeat_penalty !== '' ?
option
s.repeat_penalty : undefined,
repeat_penalty:
param
s.repeat_penalty !== '' ?
param
s.repeat_penalty : undefined,
repeat_last_n:
option
s.repeat_last_n !== '' ?
option
s.repeat_last_n : undefined,
repeat_last_n:
param
s.repeat_last_n !== '' ?
param
s.repeat_last_n : undefined,
mirostat:
option
s.mirostat !== '' ?
option
s.mirostat : undefined,
mirostat:
param
s.mirostat !== '' ?
param
s.mirostat : undefined,
mirostat_eta:
option
s.mirostat_eta !== '' ?
option
s.mirostat_eta : undefined,
mirostat_eta:
param
s.mirostat_eta !== '' ?
param
s.mirostat_eta : undefined,
mirostat_tau:
option
s.mirostat_tau !== '' ?
option
s.mirostat_tau : undefined,
mirostat_tau:
param
s.mirostat_tau !== '' ?
param
s.mirostat_tau : undefined,
top_k:
option
s.top_k !== '' ?
option
s.top_k : undefined,
top_k:
param
s.top_k !== '' ?
param
s.top_k : undefined,
top_p:
option
s.top_p !== '' ?
option
s.top_p : undefined,
top_p:
param
s.top_p !== '' ?
param
s.top_p : undefined,
tfs_z:
option
s.tfs_z !== '' ?
option
s.tfs_z : undefined,
tfs_z:
param
s.tfs_z !== '' ?
param
s.tfs_z : undefined,
num_ctx:
option
s.num_ctx !== '' ?
option
s.num_ctx : undefined,
num_ctx:
param
s.num_ctx !== '' ?
param
s.num_ctx : undefined,
num_predict:
option
s.num_predict !== '' ?
option
s.num_predict : undefined
num_predict:
param
s.num_predict !== '' ?
param
s.num_predict : undefined
},
},
keepAlive: keepAlive ? (isNaN(keepAlive) ? keepAlive : parseInt(keepAlive)) : undefined
keepAlive: keepAlive ? (isNaN(keepAlive) ? keepAlive : parseInt(keepAlive)) : undefined
});
});
...
...
src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte
View file @
ca3108a5
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
const i18n = getContext('i18n');
const i18n = getContext('i18n');
export let
option
s = {
export let
param
s = {
// Advanced
// Advanced
seed: 0,
seed: 0,
stop: '',
stop: '',
...
@@ -17,40 +17,82 @@
...
@@ -17,40 +17,82 @@
top_p: '',
top_p: '',
tfs_z: '',
tfs_z: '',
num_ctx: '',
num_ctx: '',
num_predict: ''
num_predict: '',
template: null
};
};
let customFieldName = '';
let customFieldValue = '';
</script>
</script>
<div class=" space-y-3 text-xs">
<div class=" space-y-3 text-xs">
<div>
<div class=" py-0.5 w-full justify-between">
<div class=" py-0.5 flex w-full justify-between">
<div class="flex w-full justify-between">
<div class=" w-20 text-xs font-medium self-center">{$i18n.t('Seed')}</div>
<div class=" self-center text-xs font-medium">{$i18n.t('Seed')}</div>
<div class=" flex-1 self-center">
<input
<button
class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
class="p-1 px-3 text-xs flex rounded transition"
type="number"
type="button"
placeholder="Enter Seed"
on:click={() => {
bind:value={options.seed}
params.seed = (params?.seed ?? null) === null ? 0 : null;
autocomplete="off"
}}
min="0"
>
/>
{#if (params?.seed ?? null) === null}
</div>
<span class="ml-2 self-center"> {$i18n.t('Default')} </span>
{:else}
<span class="ml-2 self-center"> {$i18n.t('Custom')} </span>
{/if}
</button>
</div>
</div>
</div>
<div>
{#if (params?.seed ?? null) !== null}
<div class=" py-0.5 flex w-full justify-between">
<div class="flex mt-0.5 space-x-2">
<div class=" w-20 text-xs font-medium self-center">{$i18n.t('Stop Sequence')}</div>
<div class=" flex-1">
<div class=" flex-1 self-center">
<input
<input
class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
type="number"
type="text"
placeholder="Enter Seed"
placeholder={$i18n.t('Enter stop sequence')}
bind:value={params.seed}
bind:value={options.stop}
autocomplete="off"
autocomplete="off"
min="0"
/>
/>
</div>
</div>
</div>
{/if}
</div>
<div class=" py-0.5 w-full justify-between">
<div class="flex w-full justify-between">
<div class=" self-center text-xs font-medium">{$i18n.t('Stop Sequence')}</div>
<button
class="p-1 px-3 text-xs flex rounded transition"
type="button"
on:click={() => {
params.stop = (params?.stop ?? null) === null ? '' : null;
}}
>
{#if (params?.stop ?? null) === null}
<span class="ml-2 self-center"> {$i18n.t('Default')} </span>
{:else}
<span class="ml-2 self-center"> {$i18n.t('Custom')} </span>
{/if}
</button>
</div>
</div>
{#if (params?.stop ?? null) !== null}
<div class="flex mt-0.5 space-x-2">
<div class=" flex-1">
<input
class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
type="text"
placeholder={$i18n.t('Enter stop sequence')}
bind:value={params.stop}
autocomplete="off"
/>
</div>
</div>
{/if}
</div>
</div>
<div class=" py-0.5 w-full justify-between">
<div class=" py-0.5 w-full justify-between">
...
@@ -61,10 +103,10 @@
...
@@ -61,10 +103,10 @@
class="p-1 px-3 text-xs flex rounded transition"
class="p-1 px-3 text-xs flex rounded transition"
type="button"
type="button"
on:click={() => {
on:click={() => {
option
s.temperature =
options
.temperature === '' ? 0.8 : '';
param
s.temperature =
(params?
.temperature
?? '')
=== '' ? 0.8 : '';
}}
}}
>
>
{#if
options
.temperature === ''}
{#if
(params?
.temperature
?? '')
=== ''}
<span class="ml-2 self-center"> {$i18n.t('Default')} </span>
<span class="ml-2 self-center"> {$i18n.t('Default')} </span>
{:else}
{:else}
<span class="ml-2 self-center"> {$i18n.t('Custom')} </span>
<span class="ml-2 self-center"> {$i18n.t('Custom')} </span>
...
@@ -72,7 +114,7 @@
...
@@ -72,7 +114,7 @@
</button>
</button>
</div>
</div>
{#if
options
.temperature !== ''}
{#if
(params?
.temperature
?? '')
!== ''}
<div class="flex mt-0.5 space-x-2">
<div class="flex mt-0.5 space-x-2">
<div class=" flex-1">
<div class=" flex-1">
<input
<input
...
@@ -81,13 +123,13 @@
...
@@ -81,13 +123,13 @@
min="0"
min="0"
max="1"
max="1"
step="0.05"
step="0.05"
bind:value={
option
s.temperature}
bind:value={
param
s.temperature}
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
/>
/>
</div>
</div>
<div>
<div>
<input
<input
bind:value={
option
s.temperature}
bind:value={
param
s.temperature}
type="number"
type="number"
class=" bg-transparent text-center w-14"
class=" bg-transparent text-center w-14"
min="0"
min="0"
...
@@ -107,18 +149,18 @@
...
@@ -107,18 +149,18 @@
class="p-1 px-3 text-xs flex rounded transition"
class="p-1 px-3 text-xs flex rounded transition"
type="button"
type="button"
on:click={() => {
on:click={() => {
option
s.mirostat =
options
.mirostat === '' ? 0 : '';
param
s.mirostat =
(params?
.mirostat
?? '')
=== '' ? 0 : '';
}}
}}
>
>
{#if
options
.mirostat === ''}
{#if
(params?
.mirostat
?? '')
=== ''}
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
{:else}
{:else}
<span class="ml-2 self-center">{$i18n.t('
Default
')}</span>
<span class="ml-2 self-center">{$i18n.t('
Custom
')}</span>
{/if}
{/if}
</button>
</button>
</div>
</div>
{#if
options
.mirostat !== ''}
{#if
(params?
.mirostat
?? '')
!== ''}
<div class="flex mt-0.5 space-x-2">
<div class="flex mt-0.5 space-x-2">
<div class=" flex-1">
<div class=" flex-1">
<input
<input
...
@@ -127,13 +169,13 @@
...
@@ -127,13 +169,13 @@
min="0"
min="0"
max="2"
max="2"
step="1"
step="1"
bind:value={
option
s.mirostat}
bind:value={
param
s.mirostat}
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
/>
/>
</div>
</div>
<div>
<div>
<input
<input
bind:value={
option
s.mirostat}
bind:value={
param
s.mirostat}
type="number"
type="number"
class=" bg-transparent text-center w-14"
class=" bg-transparent text-center w-14"
min="0"
min="0"
...
@@ -153,18 +195,18 @@
...
@@ -153,18 +195,18 @@
class="p-1 px-3 text-xs flex rounded transition"
class="p-1 px-3 text-xs flex rounded transition"
type="button"
type="button"
on:click={() => {
on:click={() => {
option
s.mirostat_eta =
options
.mirostat_eta === '' ? 0.1 : '';
param
s.mirostat_eta =
(params?
.mirostat_eta
?? '')
=== '' ? 0.1 : '';
}}
}}
>
>
{#if
options
.mirostat_eta === ''}
{#if
(params?
.mirostat_eta
?? '')
=== ''}
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
{:else}
{:else}
<span class="ml-2 self-center">{$i18n.t('
Default
')}</span>
<span class="ml-2 self-center">{$i18n.t('
Custom
')}</span>
{/if}
{/if}
</button>
</button>
</div>
</div>
{#if
options
.mirostat_eta !== ''}
{#if
(params?
.mirostat_eta
?? '')
!== ''}
<div class="flex mt-0.5 space-x-2">
<div class="flex mt-0.5 space-x-2">
<div class=" flex-1">
<div class=" flex-1">
<input
<input
...
@@ -173,13 +215,13 @@
...
@@ -173,13 +215,13 @@
min="0"
min="0"
max="1"
max="1"
step="0.05"
step="0.05"
bind:value={
option
s.mirostat_eta}
bind:value={
param
s.mirostat_eta}
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
/>
/>
</div>
</div>
<div>
<div>
<input
<input
bind:value={
option
s.mirostat_eta}
bind:value={
param
s.mirostat_eta}
type="number"
type="number"
class=" bg-transparent text-center w-14"
class=" bg-transparent text-center w-14"
min="0"
min="0"
...
@@ -199,10 +241,10 @@
...
@@ -199,10 +241,10 @@
class="p-1 px-3 text-xs flex rounded transition"
class="p-1 px-3 text-xs flex rounded transition"
type="button"
type="button"
on:click={() => {
on:click={() => {
option
s.mirostat_tau =
options
.mirostat_tau === '' ? 5.0 : '';
param
s.mirostat_tau =
(params?
.mirostat_tau
?? '')
=== '' ? 5.0 : '';
}}
}}
>
>
{#if
options
.mirostat_tau === ''}
{#if
(params?
.mirostat_tau
?? '')
=== ''}
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
{:else}
{:else}
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
...
@@ -210,7 +252,7 @@
...
@@ -210,7 +252,7 @@
</button>
</button>
</div>
</div>
{#if
options
.mirostat_tau !== ''}
{#if
(params?
.mirostat_tau
?? '')
!== ''}
<div class="flex mt-0.5 space-x-2">
<div class="flex mt-0.5 space-x-2">
<div class=" flex-1">
<div class=" flex-1">
<input
<input
...
@@ -219,13 +261,13 @@
...
@@ -219,13 +261,13 @@
min="0"
min="0"
max="10"
max="10"
step="0.5"
step="0.5"
bind:value={
option
s.mirostat_tau}
bind:value={
param
s.mirostat_tau}
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
/>
/>
</div>
</div>
<div>
<div>
<input
<input
bind:value={
option
s.mirostat_tau}
bind:value={
param
s.mirostat_tau}
type="number"
type="number"
class=" bg-transparent text-center w-14"
class=" bg-transparent text-center w-14"
min="0"
min="0"
...
@@ -245,18 +287,18 @@
...
@@ -245,18 +287,18 @@
class="p-1 px-3 text-xs flex rounded transition"
class="p-1 px-3 text-xs flex rounded transition"
type="button"
type="button"
on:click={() => {
on:click={() => {
option
s.top_k =
options.top_k
=== '' ? 40 : '';
param
s.top_k =
(params?.top_k ?? '')
=== '' ? 40 : '';
}}
}}
>
>
{#if
options.top_k
=== ''}
{#if
(params?.top_k ?? '')
=== ''}
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
{:else}
{:else}
<span class="ml-2 self-center">{$i18n.t('
Default
')}</span>
<span class="ml-2 self-center">{$i18n.t('
Custom
')}</span>
{/if}
{/if}
</button>
</button>
</div>
</div>
{#if
options.top_k
!== ''}
{#if
(params?.top_k ?? '')
!== ''}
<div class="flex mt-0.5 space-x-2">
<div class="flex mt-0.5 space-x-2">
<div class=" flex-1">
<div class=" flex-1">
<input
<input
...
@@ -265,13 +307,13 @@
...
@@ -265,13 +307,13 @@
min="0"
min="0"
max="100"
max="100"
step="0.5"
step="0.5"
bind:value={
option
s.top_k}
bind:value={
param
s.top_k}
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
/>
/>
</div>
</div>
<div>
<div>
<input
<input
bind:value={
option
s.top_k}
bind:value={
param
s.top_k}
type="number"
type="number"
class=" bg-transparent text-center w-14"
class=" bg-transparent text-center w-14"
min="0"
min="0"
...
@@ -291,18 +333,18 @@
...
@@ -291,18 +333,18 @@
class="p-1 px-3 text-xs flex rounded transition"
class="p-1 px-3 text-xs flex rounded transition"
type="button"
type="button"
on:click={() => {
on:click={() => {
option
s.top_p =
options.top_p
=== '' ? 0.9 : '';
param
s.top_p =
(params?.top_p ?? '')
=== '' ? 0.9 : '';
}}
}}
>
>
{#if
options.top_p
=== ''}
{#if
(params?.top_p ?? '')
=== ''}
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
{:else}
{:else}
<span class="ml-2 self-center">{$i18n.t('
Default
')}</span>
<span class="ml-2 self-center">{$i18n.t('
Custom
')}</span>
{/if}
{/if}
</button>
</button>
</div>
</div>
{#if
options.top_p
!== ''}
{#if
(params?.top_p ?? '')
!== ''}
<div class="flex mt-0.5 space-x-2">
<div class="flex mt-0.5 space-x-2">
<div class=" flex-1">
<div class=" flex-1">
<input
<input
...
@@ -311,13 +353,13 @@
...
@@ -311,13 +353,13 @@
min="0"
min="0"
max="1"
max="1"
step="0.05"
step="0.05"
bind:value={
option
s.top_p}
bind:value={
param
s.top_p}
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
/>
/>
</div>
</div>
<div>
<div>
<input
<input
bind:value={
option
s.top_p}
bind:value={
param
s.top_p}
type="number"
type="number"
class=" bg-transparent text-center w-14"
class=" bg-transparent text-center w-14"
min="0"
min="0"
...
@@ -337,18 +379,18 @@
...
@@ -337,18 +379,18 @@
class="p-1 px-3 text-xs flex rounded transition"
class="p-1 px-3 text-xs flex rounded transition"
type="button"
type="button"
on:click={() => {
on:click={() => {
option
s.repeat_penalty =
options
.repeat_penalty === '' ? 1.1 : '';
param
s.repeat_penalty =
(params?
.repeat_penalty
?? '')
=== '' ? 1.1 : '';
}}
}}
>
>
{#if
options
.repeat_penalty === ''}
{#if
(params?
.repeat_penalty
?? '')
=== ''}
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
{:else}
{:else}
<span class="ml-2 self-center">{$i18n.t('
Default
')}</span>
<span class="ml-2 self-center">{$i18n.t('
Custom
')}</span>
{/if}
{/if}
</button>
</button>
</div>
</div>
{#if
options
.repeat_penalty !== ''}
{#if
(params?
.repeat_penalty
?? '')
!== ''}
<div class="flex mt-0.5 space-x-2">
<div class="flex mt-0.5 space-x-2">
<div class=" flex-1">
<div class=" flex-1">
<input
<input
...
@@ -357,13 +399,13 @@
...
@@ -357,13 +399,13 @@
min="0"
min="0"
max="2"
max="2"
step="0.05"
step="0.05"
bind:value={
option
s.repeat_penalty}
bind:value={
param
s.repeat_penalty}
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
/>
/>
</div>
</div>
<div>
<div>
<input
<input
bind:value={
option
s.repeat_penalty}
bind:value={
param
s.repeat_penalty}
type="number"
type="number"
class=" bg-transparent text-center w-14"
class=" bg-transparent text-center w-14"
min="0"
min="0"
...
@@ -383,18 +425,18 @@
...
@@ -383,18 +425,18 @@
class="p-1 px-3 text-xs flex rounded transition"
class="p-1 px-3 text-xs flex rounded transition"
type="button"
type="button"
on:click={() => {
on:click={() => {
option
s.repeat_last_n =
options
.repeat_last_n === '' ? 64 : '';
param
s.repeat_last_n =
(params?
.repeat_last_n
?? '')
=== '' ? 64 : '';
}}
}}
>
>
{#if
options
.repeat_last_n === ''}
{#if
(params?
.repeat_last_n
?? '')
=== ''}
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
{:else}
{:else}
<span class="ml-2 self-center">{$i18n.t('
Default
')}</span>
<span class="ml-2 self-center">{$i18n.t('
Custom
')}</span>
{/if}
{/if}
</button>
</button>
</div>
</div>
{#if
options
.repeat_last_n !== ''}
{#if
(params?
.repeat_last_n
?? '')
!== ''}
<div class="flex mt-0.5 space-x-2">
<div class="flex mt-0.5 space-x-2">
<div class=" flex-1">
<div class=" flex-1">
<input
<input
...
@@ -403,13 +445,13 @@
...
@@ -403,13 +445,13 @@
min="-1"
min="-1"
max="128"
max="128"
step="1"
step="1"
bind:value={
option
s.repeat_last_n}
bind:value={
param
s.repeat_last_n}
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
/>
/>
</div>
</div>
<div>
<div>
<input
<input
bind:value={
option
s.repeat_last_n}
bind:value={
param
s.repeat_last_n}
type="number"
type="number"
class=" bg-transparent text-center w-14"
class=" bg-transparent text-center w-14"
min="-1"
min="-1"
...
@@ -429,18 +471,18 @@
...
@@ -429,18 +471,18 @@
class="p-1 px-3 text-xs flex rounded transition"
class="p-1 px-3 text-xs flex rounded transition"
type="button"
type="button"
on:click={() => {
on:click={() => {
option
s.tfs_z =
options.tfs_z
=== '' ? 1 : '';
param
s.tfs_z =
(params?.tfs_z ?? '')
=== '' ? 1 : '';
}}
}}
>
>
{#if
options.tfs_z
=== ''}
{#if
(params?.tfs_z ?? '')
=== ''}
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
{:else}
{:else}
<span class="ml-2 self-center">{$i18n.t('
Default
')}</span>
<span class="ml-2 self-center">{$i18n.t('
Custom
')}</span>
{/if}
{/if}
</button>
</button>
</div>
</div>
{#if
options.tfs_z
!== ''}
{#if
(params?.tfs_z ?? '')
!== ''}
<div class="flex mt-0.5 space-x-2">
<div class="flex mt-0.5 space-x-2">
<div class=" flex-1">
<div class=" flex-1">
<input
<input
...
@@ -449,13 +491,13 @@
...
@@ -449,13 +491,13 @@
min="0"
min="0"
max="2"
max="2"
step="0.05"
step="0.05"
bind:value={
option
s.tfs_z}
bind:value={
param
s.tfs_z}
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
/>
/>
</div>
</div>
<div>
<div>
<input
<input
bind:value={
option
s.tfs_z}
bind:value={
param
s.tfs_z}
type="number"
type="number"
class=" bg-transparent text-center w-14"
class=" bg-transparent text-center w-14"
min="0"
min="0"
...
@@ -475,18 +517,18 @@
...
@@ -475,18 +517,18 @@
class="p-1 px-3 text-xs flex rounded transition"
class="p-1 px-3 text-xs flex rounded transition"
type="button"
type="button"
on:click={() => {
on:click={() => {
option
s.num_ctx =
options
.num_ctx === '' ? 2048 : '';
param
s.num_ctx =
(params?
.num_ctx
?? '')
=== '' ? 2048 : '';
}}
}}
>
>
{#if
options
.num_ctx === ''}
{#if
(params?
.num_ctx
?? '')
=== ''}
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
{:else}
{:else}
<span class="ml-2 self-center">{$i18n.t('
Default
')}</span>
<span class="ml-2 self-center">{$i18n.t('
Custom
')}</span>
{/if}
{/if}
</button>
</button>
</div>
</div>
{#if
options
.num_ctx !== ''}
{#if
(params?
.num_ctx
?? '')
!== ''}
<div class="flex mt-0.5 space-x-2">
<div class="flex mt-0.5 space-x-2">
<div class=" flex-1">
<div class=" flex-1">
<input
<input
...
@@ -495,13 +537,13 @@
...
@@ -495,13 +537,13 @@
min="-1"
min="-1"
max="10240000"
max="10240000"
step="1"
step="1"
bind:value={
option
s.num_ctx}
bind:value={
param
s.num_ctx}
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
/>
/>
</div>
</div>
<div class="">
<div class="">
<input
<input
bind:value={
option
s.num_ctx}
bind:value={
param
s.num_ctx}
type="number"
type="number"
class=" bg-transparent text-center w-14"
class=" bg-transparent text-center w-14"
min="-1"
min="-1"
...
@@ -519,18 +561,18 @@
...
@@ -519,18 +561,18 @@
class="p-1 px-3 text-xs flex rounded transition"
class="p-1 px-3 text-xs flex rounded transition"
type="button"
type="button"
on:click={() => {
on:click={() => {
option
s.num_predict =
options
.num_predict === '' ? 128 : '';
param
s.num_predict =
(params?
.num_predict
?? '')
=== '' ? 128 : '';
}}
}}
>
>
{#if
options
.num_predict === ''}
{#if
(params?
.num_predict
?? '')
=== ''}
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
{:else}
{:else}
<span class="ml-2 self-center">{$i18n.t('
Default
')}</span>
<span class="ml-2 self-center">{$i18n.t('
Custom
')}</span>
{/if}
{/if}
</button>
</button>
</div>
</div>
{#if
options
.num_predict !== ''}
{#if
(params?
.num_predict
?? '')
!== ''}
<div class="flex mt-0.5 space-x-2">
<div class="flex mt-0.5 space-x-2">
<div class=" flex-1">
<div class=" flex-1">
<input
<input
...
@@ -539,13 +581,13 @@
...
@@ -539,13 +581,13 @@
min="-2"
min="-2"
max="16000"
max="16000"
step="1"
step="1"
bind:value={
option
s.num_predict}
bind:value={
param
s.num_predict}
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
/>
/>
</div>
</div>
<div class="">
<div class="">
<input
<input
bind:value={
option
s.num_predict}
bind:value={
param
s.num_predict}
type="number"
type="number"
class=" bg-transparent text-center w-14"
class=" bg-transparent text-center w-14"
min="-2"
min="-2"
...
@@ -556,4 +598,36 @@
...
@@ -556,4 +598,36 @@
</div>
</div>
{/if}
{/if}
</div>
</div>
<div class=" py-0.5 w-full justify-between">
<div class="flex w-full justify-between">
<div class=" self-center text-xs font-medium">{$i18n.t('Template')}</div>
<button
class="p-1 px-3 text-xs flex rounded transition"
type="button"
on:click={() => {
params.template = (params?.template ?? null) === null ? '' : null;
}}
>
{#if (params?.template ?? null) === null}
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
{:else}
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
{/if}
</button>
</div>
{#if (params?.template ?? null) !== null}
<div class="flex mt-0.5 space-x-2">
<div class=" flex-1">
<textarea
class="px-3 py-1.5 text-sm w-full bg-transparent border dark:border-gray-600 outline-none rounded-lg -mb-1"
placeholder="Write your model template content here"
rows="4"
bind:value={params.template}
/>
</div>
</div>
{/if}
</div>
</div>
</div>
src/lib/components/chat/Settings/General.svelte
View file @
ca3108a5
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
let requestFormat = '';
let requestFormat = '';
let keepAlive = null;
let keepAlive = null;
let
option
s = {
let
param
s = {
// Advanced
// Advanced
seed: 0,
seed: 0,
temperature: '',
temperature: '',
...
@@ -80,14 +80,14 @@
...
@@ -80,14 +80,14 @@
requestFormat = settings.requestFormat ?? '';
requestFormat = settings.requestFormat ?? '';
keepAlive = settings.keepAlive ?? null;
keepAlive = settings.keepAlive ?? null;
option
s.seed = settings.seed ?? 0;
param
s.seed = settings.seed ?? 0;
option
s.temperature = settings.temperature ?? '';
param
s.temperature = settings.temperature ?? '';
option
s.repeat_penalty = settings.repeat_penalty ?? '';
param
s.repeat_penalty = settings.repeat_penalty ?? '';
option
s.top_k = settings.top_k ?? '';
param
s.top_k = settings.top_k ?? '';
option
s.top_p = settings.top_p ?? '';
param
s.top_p = settings.top_p ?? '';
option
s.num_ctx = settings.num_ctx ?? '';
param
s.num_ctx = settings.num_ctx ?? '';
option
s = { ...
option
s, ...settings.
option
s };
param
s = { ...
param
s, ...settings.
param
s };
option
s.stop = (settings?.
option
s?.stop ?? []).join(',');
param
s.stop = (settings?.
param
s?.stop ?? []).join(',');
});
});
const applyTheme = (_theme: string) => {
const applyTheme = (_theme: string) => {
...
@@ -228,7 +228,7 @@
...
@@ -228,7 +228,7 @@
</div>
</div>
{#if showAdvanced}
{#if showAdvanced}
<AdvancedParams bind:
option
s />
<AdvancedParams bind:
param
s />
<hr class=" dark:border-gray-700" />
<hr class=" dark:border-gray-700" />
<div class=" py-1 w-full justify-between">
<div class=" py-1 w-full justify-between">
...
@@ -300,20 +300,20 @@
...
@@ -300,20 +300,20 @@
on:click={() => {
on:click={() => {
saveSettings({
saveSettings({
system: system !== '' ? system : undefined,
system: system !== '' ? system : undefined,
option
s: {
param
s: {
seed: (
option
s.seed !== 0 ?
option
s.seed : undefined) ?? undefined,
seed: (
param
s.seed !== 0 ?
param
s.seed : undefined) ?? undefined,
stop:
option
s.stop !== '' ?
option
s.stop.split(',').filter((e) => e) : undefined,
stop:
param
s.stop !== '' ?
param
s.stop.split(',').filter((e) => e) : undefined,
temperature:
option
s.temperature !== '' ?
option
s.temperature : undefined,
temperature:
param
s.temperature !== '' ?
param
s.temperature : undefined,
repeat_penalty:
option
s.repeat_penalty !== '' ?
option
s.repeat_penalty : undefined,
repeat_penalty:
param
s.repeat_penalty !== '' ?
param
s.repeat_penalty : undefined,
repeat_last_n:
option
s.repeat_last_n !== '' ?
option
s.repeat_last_n : undefined,
repeat_last_n:
param
s.repeat_last_n !== '' ?
param
s.repeat_last_n : undefined,
mirostat:
option
s.mirostat !== '' ?
option
s.mirostat : undefined,
mirostat:
param
s.mirostat !== '' ?
param
s.mirostat : undefined,
mirostat_eta:
option
s.mirostat_eta !== '' ?
option
s.mirostat_eta : undefined,
mirostat_eta:
param
s.mirostat_eta !== '' ?
param
s.mirostat_eta : undefined,
mirostat_tau:
option
s.mirostat_tau !== '' ?
option
s.mirostat_tau : undefined,
mirostat_tau:
param
s.mirostat_tau !== '' ?
param
s.mirostat_tau : undefined,
top_k:
option
s.top_k !== '' ?
option
s.top_k : undefined,
top_k:
param
s.top_k !== '' ?
param
s.top_k : undefined,
top_p:
option
s.top_p !== '' ?
option
s.top_p : undefined,
top_p:
param
s.top_p !== '' ?
param
s.top_p : undefined,
tfs_z:
option
s.tfs_z !== '' ?
option
s.tfs_z : undefined,
tfs_z:
param
s.tfs_z !== '' ?
param
s.tfs_z : undefined,
num_ctx:
option
s.num_ctx !== '' ?
option
s.num_ctx : undefined,
num_ctx:
param
s.num_ctx !== '' ?
param
s.num_ctx : undefined,
num_predict:
option
s.num_predict !== '' ?
option
s.num_predict : undefined
num_predict:
param
s.num_predict !== '' ?
param
s.num_predict : undefined
},
},
keepAlive: keepAlive ? (isNaN(keepAlive) ? keepAlive : parseInt(keepAlive)) : undefined
keepAlive: keepAlive ? (isNaN(keepAlive) ? keepAlive : parseInt(keepAlive)) : undefined
});
});
...
...
src/routes/(app)/workspace/models/create/+page.svelte
View file @
ca3108a5
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
let model = '';
let model = '';
let system = '';
let system = '';
let template = '';
let template = '';
let
option
s = {
let
param
s = {
// Advanced
// Advanced
seed: 0,
seed: 0,
stop: '',
stop: '',
...
@@ -63,19 +63,19 @@
...
@@ -63,19 +63,19 @@
$: if (!raw) {
$: if (!raw) {
content = `FROM ${model}
content = `FROM ${model}
${template !== '' ? `TEMPLATE """${template}"""` : ''}
${template !== '' ? `TEMPLATE """${template}"""` : ''}
${
option
s.seed !== 0 ? `PARAMETER seed ${
option
s.seed}` : ''}
${
param
s.seed !== 0 ? `PARAMETER seed ${
param
s.seed}` : ''}
${
option
s.stop !== '' ? `PARAMETER stop ${
option
s.stop}` : ''}
${
param
s.stop !== '' ? `PARAMETER stop ${
param
s.stop}` : ''}
${
option
s.temperature !== '' ? `PARAMETER temperature ${
option
s.temperature}` : ''}
${
param
s.temperature !== '' ? `PARAMETER temperature ${
param
s.temperature}` : ''}
${
option
s.repeat_penalty !== '' ? `PARAMETER repeat_penalty ${
option
s.repeat_penalty}` : ''}
${
param
s.repeat_penalty !== '' ? `PARAMETER repeat_penalty ${
param
s.repeat_penalty}` : ''}
${
option
s.repeat_last_n !== '' ? `PARAMETER repeat_last_n ${
option
s.repeat_last_n}` : ''}
${
param
s.repeat_last_n !== '' ? `PARAMETER repeat_last_n ${
param
s.repeat_last_n}` : ''}
${
option
s.mirostat !== '' ? `PARAMETER mirostat ${
option
s.mirostat}` : ''}
${
param
s.mirostat !== '' ? `PARAMETER mirostat ${
param
s.mirostat}` : ''}
${
option
s.mirostat_eta !== '' ? `PARAMETER mirostat_eta ${
option
s.mirostat_eta}` : ''}
${
param
s.mirostat_eta !== '' ? `PARAMETER mirostat_eta ${
param
s.mirostat_eta}` : ''}
${
option
s.mirostat_tau !== '' ? `PARAMETER mirostat_tau ${
option
s.mirostat_tau}` : ''}
${
param
s.mirostat_tau !== '' ? `PARAMETER mirostat_tau ${
param
s.mirostat_tau}` : ''}
${
option
s.top_k !== '' ? `PARAMETER top_k ${
option
s.top_k}` : ''}
${
param
s.top_k !== '' ? `PARAMETER top_k ${
param
s.top_k}` : ''}
${
option
s.top_p !== '' ? `PARAMETER top_p ${
option
s.top_p}` : ''}
${
param
s.top_p !== '' ? `PARAMETER top_p ${
param
s.top_p}` : ''}
${
option
s.tfs_z !== '' ? `PARAMETER tfs_z ${
option
s.tfs_z}` : ''}
${
param
s.tfs_z !== '' ? `PARAMETER tfs_z ${
param
s.tfs_z}` : ''}
${
option
s.num_ctx !== '' ? `PARAMETER num_ctx ${
option
s.num_ctx}` : ''}
${
param
s.num_ctx !== '' ? `PARAMETER num_ctx ${
param
s.num_ctx}` : ''}
${
option
s.num_predict !== '' ? `PARAMETER num_predict ${
option
s.num_predict}` : ''}
${
param
s.num_predict !== '' ? `PARAMETER num_predict ${
param
s.num_predict}` : ''}
SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
}
}
...
@@ -583,7 +583,7 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
...
@@ -583,7 +583,7 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
<div class=" text-xs font-semibold mb-2">{$i18n.t('Parameters')}</div>
<div class=" text-xs font-semibold mb-2">{$i18n.t('Parameters')}</div>
<div>
<div>
<AdvancedParams bind:
option
s />
<AdvancedParams bind:
param
s />
</div>
</div>
</div>
</div>
{/if}
{/if}
...
...
src/routes/(app)/workspace/models/edit/+page.svelte
View file @
ca3108a5
...
@@ -24,6 +24,9 @@
...
@@ -24,6 +24,9 @@
let
digest
=
''
;
let
digest
=
''
;
let
pullProgress
=
null
;
let
pullProgress
=
null
;
let
showAdvanced
=
false
;
let
showPreview
=
false
;
//
///////////
//
///////////
//
model
//
model
//
///////////
//
///////////
...
@@ -39,9 +42,13 @@
...
@@ -39,9 +42,13 @@
content
:
''
,
content
:
''
,
suggestion_prompts
:
[]
suggestion_prompts
:
[]
},
},
params
:
{}
params
:
{
system
:
''
}
};
};
let
params
=
{};
const
updateHandler
=
async
()
=>
{
const
updateHandler
=
async
()
=>
{
loading
=
true
;
loading
=
true
;
const
res
=
await
updateModelById
(
localStorage
.
token
,
info
.
id
,
info
);
const
res
=
await
updateModelById
(
localStorage
.
token
,
info
.
id
,
info
);
...
@@ -74,6 +81,11 @@
...
@@ -74,6 +81,11 @@
)
)
)
)
};
};
if
(
model
.
preset
&&
model
.
owned_by
===
'ollama'
&&
!info.base_model_id.includes(':')) {
info
.
base_model_id
=
`${
info
.
base_model_id
}:
latest
`;
}
console
.
log
(
model
);
console
.
log
(
model
);
}
else
{
}
else
{
goto
(
'/workspace/models'
);
goto
(
'/workspace/models'
);
...
@@ -244,8 +256,30 @@
...
@@ -244,8 +256,30 @@
</
div
>
</
div
>
</
div
>
</
div
>
{#
if
model
.
preset
}
<
div
class
=
"my-2"
>
<
div
class
=
" text-sm font-semibold mb-2"
>{$
i18n
.
t
(
'Base Model (From)'
)}</
div
>
<
div
>
<
select
class
=
"px-3 py-1.5 text-sm w-full bg-transparent border dark:border-gray-600 outline-none rounded-lg"
placeholder
=
"Select a base model (e.g. llama3, gpt-4o)"
bind
:
value
={
info
.
base_model_id
}
required
>
<
option
value
={
null
}
class
=
" placeholder:text-gray-500"
>{$
i18n
.
t
(
'Select a base model'
)}</
option
>
{#
each
$
models
.
filter
((
m
)
=>
m
.
id
!== model.id) as model}
<
option
value
={
model
.
id
}>{
model
.
name
}</
option
>
{/
each
}
</
select
>
</
div
>
</
div
>
{/
if
}
<
div
class
=
"my-2"
>
<
div
class
=
"my-2"
>
<
div
class
=
" text-sm font-semibold mb-2"
>{$
i18n
.
t
(
'
d
escription'
)}*</
div
>
<
div
class
=
" text-sm font-semibold mb-2"
>{$
i18n
.
t
(
'
D
escription'
)}*</
div
>
<
div
>
<
div
>
<
input
<
input
...
@@ -259,23 +293,49 @@
...
@@ -259,23 +293,49 @@
<
div
class
=
"my-2"
>
<
div
class
=
"my-2"
>
<
div
class
=
"flex w-full justify-between"
>
<
div
class
=
"flex w-full justify-between"
>
<
div
class
=
" self-center text-sm font-semibold"
>{$
i18n
.
t
(
'Model'
)}</
div
>
<
div
class
=
" self-center text-sm font-semibold"
>{$
i18n
.
t
(
'Model
Params
'
)}</
div
>
</
div
>
</
div
>
<
!-- <div class=" text-sm font-semibold mb-2"></div> -->
<
!-- <div class=" text-sm font-semibold mb-2"></div> -->
<
div
class
=
"mt-2"
>
<
div
class
=
"mt-2"
>
<
div
class
=
" text-xs font-semibold mb-2"
>{$
i18n
.
t
(
'Params'
)}*</
div
>
<
div
class
=
"my-1"
>
<
div
class
=
" text-xs font-semibold mb-2"
>{$
i18n
.
t
(
'System Prompt'
)}</
div
>
<
div
>
<
textarea
class
=
"px-3 py-1.5 text-sm w-full bg-transparent border dark:border-gray-600 outline-none rounded-lg -mb-1"
placeholder
={`
Write
your
model
system
prompt
content
here
\
ne
.
g
.)
You
are
Mario
from
Super
Mario
Bros
,
acting
as
an
assistant
.`}
rows
=
"4"
bind
:
value
={
info
.
params
.
system
}
/>
</
div
>
</
div
>
<
div
>
<
div
class
=
"flex w-full justify-between"
>
<
!-- <textarea
<
div
class
=
" self-center text-sm font-semibold"
>
class
=
"px-3 py-1.5 text-sm w-full bg-transparent border dark:border-gray-600 outline-none rounded-lg"
{$
i18n
.
t
(
'Advanced Params'
)}
placeholder
={`
FROM
llama2
\
nPARAMETER
temperature
1
\
nSYSTEM
"""
\n
You are Mario from Super Mario Bros, acting as an assistant.
\n
"""
`}
</
div
>
rows
=
"6"
bind
:
value
={
content
}
<
button
required
class
=
"p-1 px-3 text-xs flex rounded transition"
/>
-->
type
=
"button"
on
:
click
={()
=>
{
showAdvanced
=
!showAdvanced;
}}
>
{#
if
showAdvanced
}
<
span
class
=
"ml-2 self-center"
>{$
i18n
.
t
(
'Hide'
)}</
span
>
{:
else
}
<
span
class
=
"ml-2 self-center"
>{$
i18n
.
t
(
'Show'
)}</
span
>
{/
if
}
</
button
>
</
div
>
</
div
>
{#
if
showAdvanced
}
<
div
class
=
"my-2"
>
<
AdvancedParams
bind
:
params
/>
</
div
>
{/
if
}
</
div
>
</
div
>
</
div
>
</
div
>
...
@@ -340,6 +400,38 @@
...
@@ -340,6 +400,38 @@
</
div
>
</
div
>
</
div
>
</
div
>
<
div
class
=
"my-2 text-gray-500"
>
<
div
class
=
"flex w-full justify-between mb-2"
>
<
div
class
=
" self-center text-sm font-semibold"
>{$
i18n
.
t
(
'JSON Preview'
)}</
div
>
<
button
class
=
"p-1 px-3 text-xs flex rounded transition"
type
=
"button"
on
:
click
={()
=>
{
showPreview
=
!showPreview;
}}
>
{#
if
showPreview
}
<
span
class
=
"ml-2 self-center"
>{$
i18n
.
t
(
'Hide'
)}</
span
>
{:
else
}
<
span
class
=
"ml-2 self-center"
>{$
i18n
.
t
(
'Show'
)}</
span
>
{/
if
}
</
button
>
</
div
>
{#
if
showPreview
}
<
div
>
<
textarea
class
=
"px-3 py-1.5 text-sm w-full bg-transparent border dark:border-gray-600 outline-none rounded-lg"
rows
=
"10"
value
={
JSON
.
stringify
(
info
,
null
,
2
)}
disabled
readonly
/>
</
div
>
{/
if
}
</
div
>
{#
if
pullProgress
!== null}
{#
if
pullProgress
!== null}
<
div
class
=
"my-2"
>
<
div
class
=
"my-2"
>
<
div
class
=
" text-sm font-semibold mb-2"
>{$
i18n
.
t
(
'Pull Progress'
)}</
div
>
<
div
class
=
" text-sm font-semibold mb-2"
>{$
i18n
.
t
(
'Pull Progress'
)}</
div
>
...
...
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