refac: num_predict renamed to max_tokens
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user