Merge pull request #169 from Webifi/main

Fix issue #168
This commit is contained in:
Niek van der Maas 2023-06-12 14:52:46 +02:00 committed by GitHub
commit 63432f4c90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -36,13 +36,13 @@
let defaultModel:Model let defaultModel:Model
onMount(() => { onMount(() => {
original = message.content
defaultModel = chatSettings.model defaultModel = chatSettings.model
}) })
const edit = () => { const edit = () => {
if (message.summarized || message.streaming) return if (message.summarized || message.streaming || editing) return
editing = true editing = true
original = message.content
setTimeout(() => { setTimeout(() => {
const el = document.getElementById('edit-' + message.uuid) const el = document.getElementById('edit-' + message.uuid)
el && el.focus() el && el.focus()
@ -73,6 +73,7 @@
const keydown = (event:KeyboardEvent) => { const keydown = (event:KeyboardEvent) => {
if (event.key === 'Escape') { if (event.key === 'Escape') {
if (!editing) return
event.stopPropagation() event.stopPropagation()
event.preventDefault() event.preventDefault()
message.content = original message.content = original

View File

@ -60,7 +60,7 @@ const gptDefaults = {
n: 1, n: 1,
stream: true, stream: true,
stop: null, stop: null,
max_tokens: 512, max_tokens: 500,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0, frequency_penalty: 0,
logit_bias: null, logit_bias: null,
@ -222,7 +222,7 @@ const summarySettings: ChatSetting[] = [
name: 'Max Summary Size', name: 'Max Summary Size',
title: 'Maximum number of tokens allowed for summary response.', title: 'Maximum number of tokens allowed for summary response.',
min: 128, min: 128,
max: 2048, max: 512,
step: 1, step: 1,
type: 'number', type: 'number',
hide: (chatId) => getChatSettings(chatId).continuousChat !== 'summary' hide: (chatId) => getChatSettings(chatId).continuousChat !== 'summary'