Updated Version to 0.7.2 (#17)

This commit is contained in:
kwaroran
2023-05-08 22:54:02 +09:00
committed by GitHub
9 changed files with 93 additions and 41 deletions

View File

@@ -11,7 +11,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
platform: [ubuntu-20.04,macos-latest,windows-latest] platform: [ubuntu-20.04,macos-latest]
runs-on: ${{ matrix.platform }} runs-on: ${{ matrix.platform }}
steps: steps:

View File

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

View File

@@ -57,7 +57,9 @@ export const languageEnglish = {
+ "- **Modify Request Data** modifys current chat data when sent.\n\nIN must be a regex without flags and *\\*.\n\nOUT is a normal string." + "- **Modify Request Data** modifys current chat data when sent.\n\nIN must be a regex without flags and *\\*.\n\nOUT is a normal string."
+ "\n\n If OUT starts with **@@**, it doesn't replaces the string, but instead does a special effect if matching string founds." + "\n\n If OUT starts with **@@**, it doesn't replaces the string, but instead does a special effect if matching string founds."
+ "\n\n- @@emo (emotion name)\n\n if character is Emotion Images mode, sets (emotion name) as emotion and prevents default.", + "\n\n- @@emo (emotion name)\n\n if character is Emotion Images mode, sets (emotion name) as emotion and prevents default.",
experimental: "This is a experimental setting. it might be unstable." experimental: "This is a experimental setting. it might be unstable.",
oogaboogaURL: "If your WebUI supports older version of api, your url should look *like https:.../run/textgen*\n\n"
+ "If your WebUI supports newVersion of api, your url should look like *https://.../api/v1/generate* and use the api server as host, and add --api to arguments."
}, },
setup: { setup: {
chooseProvider: "Choose AI Provider", chooseProvider: "Choose AI Provider",

View File

@@ -127,10 +127,13 @@
</select> </select>
{/if} {/if}
{#if $DataBase.aiModel === 'textgen_webui' || $DataBase.subModel === 'textgen_webui'} {#if $DataBase.aiModel === 'textgen_webui' || $DataBase.subModel === 'textgen_webui'}
<span class="text-neutral-200">TextGen {language.providerURL}</span> <span class="text-neutral-200">TextGen {language.providerURL} <Help key="oogaboogaURL"/></span>
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected" placeholder="https://..." bind:value={$DataBase.textgenWebUIURL}> <input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected" placeholder="https://..." bind:value={$DataBase.textgenWebUIURL}>
<span class="text-draculared text-xs mb-2">You must use WebUI without agpl license or use unmodified version with agpl license to observe the contents of the agpl license.</span> <span class="text-draculared text-xs mb-2">You must use WebUI without agpl license or use unmodified version with agpl license to observe the contents of the agpl license.</span>
<span class="text-draculared text-xs mb-2">You must use textgen webui with --no-stream and without --cai-chat or --chat</span> <span class="text-draculared text-xs mb-2">You must use textgen webui with --no-stream and without --cai-chat or --chat</span>
{#if !isTauri}
<span class="text-draculared text-xs mb-2">You are using web version. you must use ngrok or other tunnels to use your local webui.</span>
{/if}
{/if} {/if}
<span class="text-neutral-200">{language.mainPrompt} <Help key="mainprompt"/></span> <span class="text-neutral-200">{language.mainPrompt} <Help key="mainprompt"/></span>
<textarea class="bg-transparent input-text mt-2 mb-2 text-gray-200 resize-none h-20 focus:bg-selected text-xs" autocomplete="off" bind:value={$DataBase.mainPrompt}></textarea> <textarea class="bg-transparent input-text mt-2 mb-2 text-gray-200 resize-none h-20 focus:bg-selected text-xs" autocomplete="off" bind:value={$DataBase.mainPrompt}></textarea>
@@ -246,23 +249,43 @@
{/if} {/if}
<span class="text-neutral-200 mt-2">WebUI {language.providerURL}</span> <span class="text-neutral-200 mt-2">WebUI {language.providerURL}</span>
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" placeholder="https://..." bind:value={$DataBase.webUiUrl}> <input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" placeholder="https://..." bind:value={$DataBase.webUiUrl}>
<span class="text-neutral-200">Steps</span>
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" type="number" min={0} max="100" bind:value={$DataBase.sdSteps}>
<span class="text-neutral-200">CFG Scale</span>
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" type="number" min={0} max="20" bind:value={$DataBase.sdCFG}>
<span class="text-neutral-200">Width</span>
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" type="number" min={0} max="2048" bind:value={$DataBase.sdConfig.width}>
<span class="text-neutral-200">Height</span>
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" type="number" min={0} max="2048" bind:value={$DataBase.sdConfig.height}>
<span class="text-neutral-200">Sampler</span>
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" bind:value={$DataBase.sdConfig.sampler_name}>
<span class="text-neutral-200">Upscaler</span>
<select class="bg-transparent input-text mt-2 mb-4 text-gray-200 appearance-none text-sm" bind:value={$DataBase.sdConfig.enable_hr}>
<option value="false" class="bg-darkbg appearance-none">Disable</option>
<option value="true" class="bg-darkbg appearance-none">Enable</option>
</select>
<div class="flex items-center mt-2">
<Check bind:check={$DataBase.sdConfig.enable_hr}/>
<span>Enable Hires</span>
</div>
{#if $DataBase.sdConfig.enable_hr === true}
<span class="text-neutral-200">denoising_strength</span>
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" type="number" min={0} max="10" bind:value={$DataBase.sdConfig.denoising_strength}>
<span class="text-neutral-200">hr_scale</span>
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" type="number" min={0} max="10" bind:value={$DataBase.sdConfig.hr_scale}>
<span class="text-neutral-200">Upscaler</span>
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" bind:value={$DataBase.sdConfig.hr_upscaler}>
{/if}
{/if} {/if}
<span class="text-neutral-200">Steps</span>
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" type="number" min={0} max="100" bind:value={$DataBase.sdSteps}>
<span class="text-neutral-200">CFG Scale</span>
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" type="number" min={0} max="20" bind:value={$DataBase.sdCFG}>
<span class="text-neutral-200">Width</span>
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" type="number" min={0} max="2048" bind:value={$DataBase.sdConfig.width}>
<span class="text-neutral-200">Height</span>
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" type="number" min={0} max="2048" bind:value={$DataBase.sdConfig.height}>
<span class="text-neutral-200">Sampler</span>
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" bind:value={$DataBase.sdConfig.sampler_name}>
{:else if subMenu === 3} {:else if subMenu == 3}
<h2 class="mb-2 text-2xl font-bold mt-2">{language.display}</h2> <h2 class="mb-2 text-2xl font-bold mt-2">{language.display}</h2>
<span class="text-neutral-200 mt-4">{language.UiLanguage}</span> <span class="text-neutral-200 mt-4">{language.UiLanguage}</span>
<select class="bg-transparent input-text mt-2 text-gray-200 appearance-none text-sm" bind:value={$DataBase.language} on:change={async () => { <select class="bg-transparent input-text mt-2 text-gray-200 appearance-none text-sm" bind:value={$DataBase.language} on:change={async () => {

View File

@@ -6,7 +6,7 @@ import { saveImage as saveImageGlobal } from './globalApi';
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 = '0.7.1' export let appVer = '0.7.2'
export function setDatabase(data:Database){ export function setDatabase(data:Database){
@@ -177,8 +177,9 @@ export function setDatabase(data:Database){
height:512, height:512,
sampler_name:"Euler a", sampler_name:"Euler a",
script_name:"", script_name:"",
denoising_strength:0.7,
enable_hr:false, enable_hr:false,
hr_scale: 2, hr_scale:1.25,
hr_upscaler:"Latent" hr_upscaler:"Latent"
} }
} }
@@ -346,6 +347,7 @@ interface sdConfig{
height:number height:number
sampler_name:string sampler_name:string
script_name:string script_name:string
denoising_strength:number
enable_hr:boolean enable_hr:boolean
hr_scale: number hr_scale: number
hr_upscaler:string hr_upscaler:string

View File

@@ -109,20 +109,10 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
} }
case "textgen_webui":{ case "textgen_webui":{
let DURL = db.textgenWebUIURL let DURL = db.textgenWebUIURL
if((!DURL.endsWith('textgen')) && (!DURL.endsWith('textgen/'))){ let bodyTemplate:any
if(DURL.endsWith('/')){
DURL += 'run/textgen'
}
else{
DURL += '/run/textgen'
}
}
const proompt = stringlizeChat(formated, currentChar.name) const proompt = stringlizeChat(formated, currentChar.name)
if(DURL.includes('api')){
const payload = [ bodyTemplate = {
proompt,
{
'max_new_tokens': 80, 'max_new_tokens': 80,
'do_sample': true, 'do_sample': true,
'temperature': (db.temperature / 100), 'temperature': (db.temperature / 100),
@@ -139,14 +129,41 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
'early_stopping': false, 'early_stopping': false,
'truncation_length': maxTokens, 'truncation_length': maxTokens,
'ban_eos_token': false, 'ban_eos_token': false,
'custom_stopping_strings': [`\nUser:`], 'custom_stopping_strings': [`\nUser:`,`\nuser:`],
'seed': -1, 'seed': -1,
add_bos_token: true, add_bos_token: true,
prompt: proompt
} }
]; }
else{
const payload = [
proompt,
{
'max_new_tokens': 80,
'do_sample': true,
'temperature': (db.temperature / 100),
'top_p': 0.9,
'typical_p': 1,
'repetition_penalty': (db.PresensePenalty / 100),
'encoder_repetition_penalty': 1,
'top_k': 100,
'min_length': 0,
'no_repeat_ngram_size': 0,
'num_beams': 1,
'penalty_alpha': 0,
'length_penalty': 1,
'early_stopping': false,
'truncation_length': maxTokens,
'ban_eos_token': false,
'custom_stopping_strings': [`\nUser:`,`\nuser:`],
'seed': -1,
add_bos_token: true,
}
];
const bodyTemplate = { "data": [JSON.stringify(payload)] }; bodyTemplate = { "data": [JSON.stringify(payload)] };
}
const res = await globalFetch(DURL, { const res = await globalFetch(DURL, {
body: bodyTemplate, body: bodyTemplate,
headers: {} headers: {}

View File

@@ -4,6 +4,7 @@ import { requestChatData } from "./request"
import { alertError } from "../alert" import { alertError } from "../alert"
import { globalFetch } from "../globalApi" import { globalFetch } from "../globalApi"
import { CharEmotion } from "../stores" import { CharEmotion } from "../stores"
import type { OpenAIChat } from "."
export async function stableDiff(currentChar:character,prompt:string){ export async function stableDiff(currentChar:character,prompt:string){
@@ -128,7 +129,14 @@ export async function stableDiff(currentChar:character,prompt:string){
"cfg_scale": db.sdCFG, "cfg_scale": db.sdCFG,
"prompt": prompts.join(','), "prompt": prompts.join(','),
"negative_prompt": neg, "negative_prompt": neg,
'sampler_name': db.sdConfig.sampler_name 'sampler_name': db.sdConfig.sampler_name,
"enable_hr": db.sdConfig.enable_hr,
"denoising_strength": db.sdConfig.denoising_strength,
"hr_scale": db.sdConfig.hr_scale,
"hr_upscaler": db.sdConfig.hr_upscaler
},
headers:{
'Content-Type': 'application/json'
} }
}) })

View File

@@ -11,10 +11,10 @@ export function stringlizeChat(formated:OpenAIChat[], char:string = ''){
resultString.push("'System Note: " + form.content) resultString.push("'System Note: " + form.content)
} }
else if(form.role === 'user'){ else if(form.role === 'user'){
resultString.push("User: " + form.content) resultString.push("user: " + form.content)
} }
else if(form.role === 'assistant'){ else if(form.role === 'assistant'){
resultString.push("Assistant: " + form.content) resultString.push("assistant: " + form.content)
} }
} }
return resultString.join('\n\n') + `\n\n${char}:` return resultString.join('\n\n') + `\n\n${char}:`

View File

@@ -1 +1 @@
{"version":"0.7.1"} {"version":"0.7.2"}