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
commit 9a81a37008
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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>

View File

@ -614,7 +614,7 @@
"Sign up": "注册",
"Signing in": "正在登录",
"Source": "来源",
"Speech Playback Speed": "",
"Speech Playback Speed": "语音播放速度",
"Speech recognition error: {{error}}": "语音识别错误:{{error}}",
"Speech-to-Text Engine": "语音转文本引擎",
"Stop Sequence": "停止序列 (Stop Sequence)",

View File

@ -615,7 +615,7 @@
"Sign up": "註冊",
"Signing in": "正在登入",
"Source": "來源",
"Speech Playback Speed": "",
"Speech Playback Speed": "語音播放速度",
"Speech recognition error: {{error}}": "語音辨識錯誤:{{error}}",
"Speech-to-Text Engine": "語音轉文字 (STT) 引擎",
"Stop Sequence": "停止序列",