Add supamemory max chunk size and remove deprecated

This commit is contained in:
kwaroran
2024-04-08 23:42:30 +09:00
parent 74385237ab
commit 8d094d5b66
6 changed files with 16 additions and 10 deletions

View File

@@ -8,7 +8,7 @@
}, },
"package": { "package": {
"productName": "RisuAI", "productName": "RisuAI",
"version": "1.93.4" "version": "1.93.5"
}, },
"tauri": { "tauri": {
"allowlist": { "allowlist": {

View File

@@ -559,5 +559,6 @@ export const languageEnglish = {
updateRealm: "Update to RisuRealm", updateRealm: "Update to RisuRealm",
updateRealmDesc: "You are trying to update your character to RisuRealm. this will update your character to RisuRealm, and you can't revert it back.", updateRealmDesc: "You are trying to update your character to RisuRealm. this will update your character to RisuRealm, and you can't revert it back.",
antiClaudeOverload: "Anti-Claude Overload", antiClaudeOverload: "Anti-Claude Overload",
activeTabChange: "Current tab is inactivated since other tab is active. to activate this tab, click OK" activeTabChange: "Current tab is inactivated since other tab is active. to activate this tab, click OK",
maxSupaChunkSize: "Max SupaMemory Chunk Size",
} }

View File

@@ -213,17 +213,17 @@
<OptionInput value="none" >None</OptionInput> <OptionInput value="none" >None</OptionInput>
<OptionInput value="distilbart" >distilbart-cnn-6-6 (Free/Local)</OptionInput> <OptionInput value="distilbart" >distilbart-cnn-6-6 (Free/Local)</OptionInput>
<OptionInput value="instruct35" >OpenAI 3.5 Turbo Instruct</OptionInput> <OptionInput value="instruct35" >OpenAI 3.5 Turbo Instruct</OptionInput>
<OptionInput value="davinci" >OpenAI Davinci</OptionInput> <OptionInput value="subModel" >{language.submodel}</OptionInput>
<OptionInput value="curie" >OpenAI Curie</OptionInput>
<OptionInput value="subModel" >{language.submodel} ({language.unrecommended})</OptionInput>
</SelectInput> </SelectInput>
<span class="text-textcolor">{language.maxSupaChunkSize}</span>
<NumberInput size="sm" marginBottom bind:value={$DataBase.maxSupaChunkSize} min={100} />
{#if $DataBase.supaMemoryType === 'davinci' || $DataBase.supaMemoryType === 'curie' || $DataBase.supaMemoryType === 'instruct35'} {#if $DataBase.supaMemoryType === 'davinci' || $DataBase.supaMemoryType === 'curie' || $DataBase.supaMemoryType === 'instruct35'}
<span class="text-textcolor">{language.SuperMemory} OpenAI Key</span> <span class="text-textcolor">{language.SuperMemory} OpenAI Key</span>
<TextInput size="sm" marginBottom bind:value={$DataBase.supaMemoryKey}/> <TextInput size="sm" marginBottom bind:value={$DataBase.supaMemoryKey}/>
{/if} {/if}
{#if $DataBase.supaMemoryType !== 'none'} {#if $DataBase.supaMemoryType !== 'none'}
<span class="text-textcolor">{language.SuperMemory} Prompt</span> <span class="text-textcolor">{language.SuperMemory} Prompt</span>
<TextInput size="sm" marginBottom bind:value={$DataBase.supaMemoryPrompt} placeholder="recommended to leave it blank to use default"/> <TextInput size="sm" marginBottom bind:value={$DataBase.supaMemoryPrompt} placeholder="Leave it blank to use default"/>
{/if} {/if}
{#if $DataBase.hypaMemory} {#if $DataBase.hypaMemory}
<span class="text-textcolor">{language.HypaMemory} Model</span> <span class="text-textcolor">{language.HypaMemory} Model</span>
@@ -233,6 +233,6 @@
</SelectInput> </SelectInput>
{/if} {/if}
<div class="flex"> <div class="flex">
<Check bind:check={$DataBase.hypaMemory} name={language.able + ' ' + language.HypaMemory}/> <Check bind:check={$DataBase.hypaMemory} name={language.enable + ' ' + language.HypaMemory}/>
</div> </div>
</Arcodion> </Arcodion>

View File

@@ -266,7 +266,10 @@ export async function supaMemory(
while(currentTokens > maxContextTokens){ while(currentTokens > maxContextTokens){
const beforeToken = currentTokens const beforeToken = currentTokens
let maxChunkSize = maxContextTokens > 3500 ? 1200 : Math.floor(maxContextTokens / 3) let maxChunkSize = Math.floor(maxContextTokens / 3)
if(db.maxSupaChunkSize > maxChunkSize){
maxChunkSize = db.maxSupaChunkSize
}
let summarized = false let summarized = false
let chunkSize = 0 let chunkSize = 0
let stringlizedChat = '' let stringlizedChat = ''

View File

@@ -15,7 +15,7 @@ import type { OobaChatCompletionRequestParams } from '../model/ooba';
export const DataBase = writable({} as any as Database) export const DataBase = writable({} as any as Database)
export const loadedStore = writable(false) export const loadedStore = writable(false)
export let appVer = "1.93.4" export let appVer = "1.93.5"
export let webAppSubVer = '' export let webAppSubVer = ''
export function setDatabase(data:Database){ export function setDatabase(data:Database){
@@ -382,6 +382,7 @@ export function setDatabase(data:Database){
data.additionalParams ??= [] data.additionalParams ??= []
data.heightMode ??= 'normal' data.heightMode ??= 'normal'
data.antiClaudeOverload ??= false data.antiClaudeOverload ??= false
data.maxSupaChunkSize ??= 1200
changeLanguage(data.language) changeLanguage(data.language)
DataBase.set(data) DataBase.set(data)
@@ -616,6 +617,7 @@ export interface Database{
useAdvancedEditor:boolean useAdvancedEditor:boolean
noWaitForTranslate:boolean noWaitForTranslate:boolean
antiClaudeOverload:boolean antiClaudeOverload:boolean
maxSupaChunkSize:number
} }
export interface customscript{ export interface customscript{

View File

@@ -1 +1 @@
{"version":"1.93.4"} {"version":"1.93.5"}