diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index a6196bcfd..c6b125381 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -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 }, diff --git a/src/lib/components/chat/Settings/Advanced.svelte b/src/lib/components/chat/Settings/Advanced.svelte index e13a8babc..92f39029c 100644 --- a/src/lib/components/chat/Settings/Advanced.svelte +++ b/src/lib/components/chat/Settings/Advanced.svelte @@ -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 }); diff --git a/src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte b/src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte index aff454832..dc214e4a2 100644 --- a/src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte +++ b/src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte @@ -19,7 +19,7 @@ top_p: '', tfs_z: '', num_ctx: '', - num_predict: '', + max_tokens: '', template: null }; @@ -561,16 +561,16 @@
-
{$i18n.t('Max Tokens')}
+
{$i18n.t('Max Tokens (num_predict)')}
- {#if (params?.num_predict ?? '') !== ''} + {#if (params?.max_tokens ?? '') !== ''}
{ @@ -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 });