Merge pull request #5645 from kivvi3412/main

[feat] Set whether to stream individually for the model
This commit is contained in:
Timothy Jaeryang Baek
2024-09-24 10:52:00 +02:00
committed by GitHub
4 changed files with 29 additions and 4 deletions

View File

@@ -952,7 +952,7 @@
await tick();
const stream = $settings?.streamResponse ?? true;
const stream = model?.info?.params?.stream_response ?? $settings?.streamResponse ?? true;
const [res, controller] = await generateChatCompletion(localStorage.token, {
stream: stream,
model: model.id,
@@ -1248,7 +1248,7 @@
await tick();
try {
const stream = $settings?.streamResponse ?? true;
const stream = model?.info?.params?.stream_response ?? $settings?.streamResponse ?? true;
const [res, controller] = await generateOpenAIChatCompletion(
localStorage.token,
{

View File

@@ -10,6 +10,7 @@
export let params = {
// Advanced
stream_response: null, // Set stream responses for this model individually
seed: null,
stop: null,
temperature: null,
@@ -42,6 +43,30 @@
</script>
<div class=" space-y-1 text-xs pb-safe-bottom">
<div>
<div class=" py-0.5 flex w-full justify-between">
<div class=" self-center text-xs">
{$i18n.t('Stream Chat Response')}
</div>
<button
class="p-1 px-3 text-xs flex rounded transition"
on:click={() => {
params.stream_response = (params?.stream_response ?? null) === null ? true : (params.stream_response ? false : null);
}}
type="button"
>
{#if params.stream_response === true}
<span class="ml-2 self-center">{$i18n.t('On')}</span>
{:else if params.stream_response === false}
<span class="ml-2 self-center">{$i18n.t('Off')}</span>
{:else}
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
{/if}
</button>
</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('Seed')}</div>