feat: stream delta chunk
Co-Authored-By: Jan Kessler <Ithanil@users.noreply.github.com>
This commit is contained in:
co-authored by
Jan Kessler
parent
e2b2e8b245
commit
1a93891d97
@@ -15,6 +15,7 @@
|
||||
const defaultParams = {
|
||||
// Advanced
|
||||
stream_response: null, // Set stream responses for this model individually
|
||||
stream_delta_chunk_size: null, // Set the chunk size for streaming responses
|
||||
function_calling: null,
|
||||
seed: null,
|
||||
stop: null,
|
||||
@@ -88,6 +89,63 @@
|
||||
</Tooltip>
|
||||
</div>
|
||||
|
||||
{#if admin}
|
||||
<div>
|
||||
<Tooltip
|
||||
content={$i18n.t(
|
||||
'The stream delta chunk size for the model. Increasing the chunk size will make the model respond with larger pieces of text at once.'
|
||||
)}
|
||||
placement="top-start"
|
||||
className="inline-tooltip"
|
||||
>
|
||||
<div class="flex w-full justify-between">
|
||||
<div class=" self-center text-xs font-medium">
|
||||
{$i18n.t('Stream Delta Chunk Size')}
|
||||
</div>
|
||||
<button
|
||||
class="p-1 px-3 text-xs flex rounded-sm transition shrink-0 outline-hidden"
|
||||
type="button"
|
||||
on:click={() => {
|
||||
params.stream_delta_chunk_size =
|
||||
(params?.stream_delta_chunk_size ?? null) === null ? 1 : null;
|
||||
}}
|
||||
>
|
||||
{#if (params?.stream_delta_chunk_size ?? 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>
|
||||
</Tooltip>
|
||||
|
||||
{#if (params?.stream_delta_chunk_size ?? null) !== null}
|
||||
<div class="flex mt-0.5 space-x-2">
|
||||
<div class=" flex-1">
|
||||
<input
|
||||
id="steps-range"
|
||||
type="range"
|
||||
min="1"
|
||||
max="128"
|
||||
step="1"
|
||||
bind:value={params.stream_delta_chunk_size}
|
||||
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<input
|
||||
bind:value={params.stream_delta_chunk_size}
|
||||
type="number"
|
||||
class=" bg-transparent text-center w-14"
|
||||
min="1"
|
||||
step="any"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div>
|
||||
<Tooltip
|
||||
content={$i18n.t(
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
let params = {
|
||||
// Advanced
|
||||
stream_response: null,
|
||||
stream_delta_chunk_size: null,
|
||||
function_calling: null,
|
||||
seed: null,
|
||||
temperature: null,
|
||||
@@ -71,6 +72,8 @@
|
||||
system: system !== '' ? system : undefined,
|
||||
params: {
|
||||
stream_response: params.stream_response !== null ? params.stream_response : undefined,
|
||||
stream_delta_chunk_size:
|
||||
params.stream_delta_chunk_size !== null ? params.stream_delta_chunk_size : undefined,
|
||||
function_calling: params.function_calling !== null ? params.function_calling : undefined,
|
||||
seed: (params.seed !== null ? params.seed : undefined) ?? undefined,
|
||||
stop: params.stop ? params.stop.split(',').filter((e) => e) : undefined,
|
||||
|
||||
Reference in New Issue
Block a user