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
bd6ccf8c
"ts/webui/src/static/style/button.scss" did not exist on "8f778aa563bb9f99b34085d69327c096003c9449"
Commit
bd6ccf8c
authored
May 25, 2024
by
Timothy J. Baek
Browse files
refac: num_predict renamed to max_tokens
parent
1aa33a46
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
14 deletions
+14
-14
src/lib/components/chat/Chat.svelte
src/lib/components/chat/Chat.svelte
+3
-3
src/lib/components/chat/Settings/Advanced.svelte
src/lib/components/chat/Settings/Advanced.svelte
+2
-2
src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte
...b/components/chat/Settings/Advanced/AdvancedParams.svelte
+7
-7
src/lib/components/chat/Settings/General.svelte
src/lib/components/chat/Settings/General.svelte
+2
-2
No files found.
src/lib/components/chat/Chat.svelte
View file @
bd6ccf8c
...
...
@@ -479,7 +479,8 @@
?
$
settings
.
params
.
stop
.
map
((
str
)
=>
decodeURIComponent
(
JSON
.
parse
(
'"'
+
str
.
replace
(/\
"/g, '
\\
"
') + '
"'))
)
: undefined
: undefined,
num_predict: $settings?.params?.max_tokens ?? undefined
},
format: $settings.requestFormat ?? undefined,
keep_alive: $settings.keepAlive ?? undefined,
...
...
@@ -726,9 +727,8 @@
: undefined,
temperature: $settings?.params?.temperature ?? undefined,
top_p: $settings?.params?.top_p ?? undefined,
num_ctx: $settings?.params?.num_ctx ?? undefined,
frequency_penalty: $settings?.params?.repeat_penalty ?? undefined,
max_tokens: $settings?.params?.
num_predict
?? undefined,
max_tokens: $settings?.params?.
max_tokens
?? undefined,
docs: docs.length > 0 ? docs : undefined,
citations: docs.length > 0
},
...
...
src/lib/components/chat/Settings/Advanced.svelte
View file @
bd6ccf8c
...
...
@@ -25,7 +25,7 @@
stop: '',
tfs_z: '',
num_ctx: '',
num_predict
: ''
max_tokens
: ''
};
const toggleRequestFormat = async () => {
...
...
@@ -141,7 +141,7 @@
top_p: params.top_p !== '' ? params.top_p : undefined,
tfs_z: params.tfs_z !== '' ? params.tfs_z : undefined,
num_ctx: params.num_ctx !== '' ? params.num_ctx : undefined,
num_predict: params.num_predict
!== '' ? params.
num_predict
: undefined
max_tokens: params.max_tokens
!== '' ? params.
max_tokens
: undefined
},
keepAlive: keepAlive ? (isNaN(keepAlive) ? keepAlive : parseInt(keepAlive)) : undefined
});
...
...
src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte
View file @
bd6ccf8c
...
...
@@ -19,7 +19,7 @@
top_p: '',
tfs_z: '',
num_ctx: '',
num_predict
: '',
max_tokens
: '',
template: null
};
...
...
@@ -561,16 +561,16 @@
</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('Max Tokens')}</div>
<div class=" self-center text-xs font-medium">{$i18n.t('Max Tokens
(num_predict)
')}</div>
<button
class="p-1 px-3 text-xs flex rounded transition"
type="button"
on:click={() => {
params.
num_predict
= (params?.
num_predict
?? '') === '' ? 128 : '';
params.
max_tokens
= (params?.
max_tokens
?? '') === '' ? 128 : '';
}}
>
{#if (params?.
num_predict
?? '') === ''}
{#if (params?.
max_tokens
?? '') === ''}
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
{:else}
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
...
...
@@ -578,7 +578,7 @@
</button>
</div>
{#if (params?.
num_predict
?? '') !== ''}
{#if (params?.
max_tokens
?? '') !== ''}
<div class="flex mt-0.5 space-x-2">
<div class=" flex-1">
<input
...
...
@@ -587,13 +587,13 @@
min="-2"
max="16000"
step="1"
bind:value={params.
num_predict
}
bind:value={params.
max_tokens
}
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
/>
</div>
<div class="">
<input
bind:value={params.
num_predict
}
bind:value={params.
max_tokens
}
type="number"
class=" bg-transparent text-center w-14"
min="-2"
...
...
src/lib/components/chat/Settings/General.svelte
View file @
bd6ccf8c
...
...
@@ -55,7 +55,7 @@
stop: '',
tfs_z: '',
num_ctx: '',
num_predict
: ''
max_tokens
: ''
};
const toggleRequestFormat = async () => {
...
...
@@ -313,7 +313,7 @@
top_p: params.top_p !== '' ? params.top_p : undefined,
tfs_z: params.tfs_z !== '' ? params.tfs_z : undefined,
num_ctx: params.num_ctx !== '' ? params.num_ctx : undefined,
num_predict: params.num_predict
!== '' ? params.
num_predict
: undefined
max_tokens: params.max_tokens
!== '' ? params.
max_tokens
: undefined
},
keepAlive: keepAlive ? (isNaN(keepAlive) ? keepAlive : parseInt(keepAlive)) : undefined
});
...
...
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