Update version, gemini models, and new progress dialoge, and charxjpeg

This commit is contained in:
Kwaroran
2025-02-06 09:48:55 +09:00
parent 0242fd27cc
commit 1b171cab66
18 changed files with 231 additions and 82 deletions

View File

@@ -18,7 +18,6 @@
import MobileFooter from './lib/Mobile/MobileFooter.svelte';
import CustomGUISettingMenu from './lib/Setting/Pages/CustomGUISettingMenu.svelte';
import { checkCharOrder } from './ts/globalApi.svelte';
import Googli from './lib/UI/Googli.svelte';
let didFirstSetup: boolean = $derived(DBState.db?.didFirstSetup)
@@ -51,9 +50,6 @@
</div>
<span class="text-sm mt-2 text-textcolor2">{LoadingStatusState.text}</span>
<Googli className="mt-4" />
</div>
{:else if $CustomGUISettingMenuStore}
<CustomGUISettingMenu />

View File

@@ -25,6 +25,7 @@
import { getCurrentCharacter } from "src/ts/storage/database.svelte";
import { message } from "@tauri-apps/plugin-dialog";
import HypaV3Modal from './HypaV3Modal.svelte';
import Googli from "../UI/Googli.svelte";
let btn
let input = $state('')
let cardExportType = $state('realm')
@@ -107,10 +108,22 @@
}}>Terms of Service</a> to continue</div>
{:else if $alertStore.type !== 'select' && $alertStore.type !== 'requestdata' && $alertStore.type !== 'addchar' && $alertStore.type !== 'hypaV2' && $alertStore.type !== 'chatOptions'}
<span class="text-gray-300">{$alertStore.msg}</span>
{#if $alertStore.submsg}
{#if $alertStore.submsg && $alertStore.type !== 'progress'}
<span class="text-gray-500 text-sm">{$alertStore.submsg}</span>
{/if}
{/if}
{#if $alertStore.type === 'progress'}
<div class="w-full min-w-64 md:min-w-138 h-2 bg-darkbg border border-darkborderc rounded-md mt-6">
<div class="h-full bg-gradient-to-r from-blue-500 to-purple-800 saving-animation transition-[width]" style:width={$alertStore.submsg + '%'}></div>
</div>
<div class="w-full flex justify-center mt-6">
<span class="text-gray-500 text-sm">{$alertStore.submsg + '%'}</span>
</div>
<div class="w-full flex justify-center">
<Googli className="mt-14" />
</div>
{/if}
{#if $alertStore.type === 'ask'}
<div class="flex gap-2 w-full">
<Button className="mt-4 flex-grow" onclick={() => {

View File

@@ -20,23 +20,4 @@
}}>
<AlertOctagon size={24} />
</button>
{/if}
<style>
.saving-animation {
animation: saving-anime 1s infinite;
background-size: 200% auto;
}
@keyframes saving-anime {
0% {
background-position: 0 0;
}
50% {
background-position: 100% 100%;
}
100% {
background-position: 0 0;
}
}
</style>
{/if}

View File

@@ -1,27 +1,43 @@
<script lang="ts">
import { onMount } from "svelte";
export let className: string = "";
interface Props {
className?: string;
}
let { className = $bindable() }:Props = $props();
onMount(() => {
if(!import.meta.env.VITE_AD_CLIENT){
return
}
//@ts-ignore
(window.adsbygoogle = window.adsbygoogle || []).push({});
try{
//@ts-ignore
(window.adsbygoogle = window.adsbygoogle || []).push({});
}catch{}
});
</script>
{#if !import.meta.env.VITE_AD_CLIENT}
<div
class={className}
>
<ins
class="adsbygoogle"
style="display:block"
data-ad-client={import.meta.env.VITE_AD_CLIENT}
data-ad-slot={import.meta.env.VITE_AD_SLOT}
data-ad-format="auto"
data-full-width-responsive="true"
></ins>
</div>
{#if import.meta.env.VITE_AD_CLIENT}
{#if import.meta.env.VITE_AD_CLIENT === 'TEST'}
<div
class={className}
>
<div
class="bg-slate-500"
style={window.innerWidth > 728 ? "display:block !important;width:728px;height:90px" : "display:block !important;width:300px;height:100px"}
>TEST</div>
</div>
{:else}
<div
class={className}
>
<ins
class="adsbygoogle"
style={window.innerWidth > 728 ? "display:block !important;width:728px;height:90px" : "display:block !important;width:300px;height:100px"}
data-ad-client={window.innerWidth > 728 ? import.meta.env.VITE_AD_CLIENT : import.meta.env.VITE_AD_CLIENT_MOBILE}
data-ad-slot={window.innerWidth > 728 ? import.meta.env.VITE_AD_SLOT : import.meta.env.VITE_AD_SLOT_MOBILE}
></ins>
</div>
{/if}
{/if}

View File

@@ -8,6 +8,7 @@
import RealmLicense from "./RealmLicense.svelte";
import MultiLangDisplay from "../GUI/MultiLangDisplay.svelte";
import { tooltip } from "src/ts/gui/tooltip";
import Googli from "../Googli.svelte";
interface Props {
openedData: hubType;
@@ -50,6 +51,7 @@
<span class="text-textcolor2" use:tooltip={language.popularityLevelDesc}>
{language.popularityLevel.replace('{}', openedData.download.toString())}
</span>
<div class="border-l-selected border-l ml-1 mr-1"></div>
{#if openedData.hasEmotion}
<button class="text-textcolor2 hover:text-green-500 transition-colors" onclick={((e) => {
@@ -69,6 +71,9 @@
</div>
</div>
<Googli />
<div class="flex flex-row-reverse gap-2">
<button class="text-textcolor2 hover:text-red-500" onclick={(async (e) => {
e.stopPropagation()

View File

@@ -272,6 +272,23 @@ html, body{
z-index: 100;
}
.saving-animation {
animation: saving-anime 1s infinite;
background-size: 200% auto;
}
@keyframes saving-anime {
0% {
background-position: 0 0;
}
50% {
background-position: 100% 100%;
}
100% {
background-position: 0 0;
}
}
.flexium{
display: flex;
flex-direction: row;

View File

@@ -10,7 +10,7 @@ export interface alertData{
type: 'error'|'normal'|'none'|'ask'|'wait'|'selectChar'
|'input'|'toast'|'wait2'|'markdown'|'select'|'login'
|'tos'|'cardexport'|'requestdata'|'addchar'|'hypaV2'|'selectModule'
|'chatOptions'|'pukmakkurit'|'branches'|'hypaV3',
|'chatOptions'|'pukmakkurit'|'branches'|'hypaV3'|'progress',
msg: string,
submsg?: string
}

View File

@@ -120,6 +120,36 @@ export async function importCharacterProcess(f:{
let readedChara = ''
let readedCCv3 = ''
let img:Uint8Array
let pngChunks = 0
let readedPngChunks = 0
{
let readData:File | Uint8Array | ReadableStream<Uint8Array>
if(f.data instanceof ReadableStream){
const tee = f.data.tee()
f.data = tee[0]
readData = tee[1]
}
else{
readData = f.data
}
const prereader = PngChunk.readGenerator(readData, {
})
for await(const chunk of prereader){
if(chunk instanceof AppendableBuffer){
break
}
if(chunk.key.startsWith('chara-ext-asset_')){
pngChunks++
}
}
}
const readGenerator = PngChunk.readGenerator(f.data, {
returnTrimed: true
})
@@ -151,8 +181,20 @@ export async function importCharacterProcess(f:{
}
if(chunk.key.startsWith('chara-ext-asset_')){
const assetIndex = chunk.key.replace('chara-ext-asset_:', '').replace('chara-ext-asset_', '')
alertWait('Loading... (Reading Asset ' + assetIndex + ')' )
const assetData = Buffer.from(chunk.value, 'base64')
if(pngChunks === 0){
alertWait('Loading... (Loaded ' + readedPngChunks + ' Assets)')
}
else{
alertStore.set({
type: 'progress',
msg: 'Loading... (Loading Assets)',
submsg: (readedPngChunks / pngChunks * 100).toFixed(2)
})
}
readedPngChunks++
if(db.account?.useSync && f.lightningRealmImport){
const id = await hasher(assetData)
const xid = 'assets/' + id + '.png'
@@ -656,8 +698,9 @@ async function importCharacterCardSpec(card:CharacterCardV2Risu|CharacterCardV3,
if(risuext.emotions){
for(let i=0;i<risuext.emotions.length;i++){
alertStore.set({
type: 'wait',
msg: `Loading... (Getting Emotions ${i} / ${risuext.emotions.length})`
type: 'progress',
msg: `Loading... (Loading Emotions)`,
submsg: (i / risuext.emotions.length * 100).toFixed(2)
})
await sleep(10)
if(risuext.emotions[i][1].startsWith('__asset:')){
@@ -676,8 +719,9 @@ async function importCharacterCardSpec(card:CharacterCardV2Risu|CharacterCardV3,
if(risuext.additionalAssets){
for(let i=0;i<risuext.additionalAssets.length;i++){
alertStore.set({
type: 'wait',
msg: `Loading... (Getting Assets ${i} / ${risuext.additionalAssets.length})`
type: 'progress',
msg: `Loading... (Loading Assets)`,
submsg: (i / risuext.additionalAssets.length * 100).toFixed(2)
})
await sleep(10)
let fileName = ''
@@ -700,8 +744,9 @@ async function importCharacterCardSpec(card:CharacterCardV2Risu|CharacterCardV3,
const keys = Object.keys(risuext.vits)
for(let i=0;i<keys.length;i++){
alertStore.set({
type: 'wait',
msg: `Loading... (Getting VITS ${i} / ${keys.length})`
type: 'progress',
msg: `Loading... (Loading VITS)`,
submsg: (i / keys.length * 100).toFixed(2)
})
await sleep(10)
const key = keys[i]
@@ -742,8 +787,9 @@ async function importCharacterCardSpec(card:CharacterCardV2Risu|CharacterCardV3,
if(data.assets){
for(let i=0;i<data.assets.length;i++){
alertStore.set({
type: 'wait',
msg: `Loading... (Getting Assets ${i} / ${data.assets.length})`
type: 'progress',
msg: `Loading... (Assets)`,
submsg: (i / data.assets.length * 100).toFixed(2)
})
await sleep(10)
let fileName = ''
@@ -1164,8 +1210,9 @@ export async function exportCharacterCard(char:character, type:'png'|'json'|'cha
if(card.data.extensions.risuai.emotions && card.data.extensions.risuai.emotions.length > 0){
for(let i=0;i<card.data.extensions.risuai.emotions.length;i++){
alertStore.set({
type: 'wait',
msg: `Loading... (Adding Emotions ${i} / ${card.data.extensions.risuai.emotions.length})`
type: 'progress',
msg: 'Loading... (Adding Emotions)',
submsg: (i / card.data.extensions.risuai.emotions.length * 100).toFixed(2)
})
const key = card.data.extensions.risuai.emotions[i][1]
const rData = await readImage(key)
@@ -1180,8 +1227,9 @@ export async function exportCharacterCard(char:character, type:'png'|'json'|'cha
if(card.data.extensions.risuai.additionalAssets && card.data.extensions.risuai.additionalAssets.length > 0){
for(let i=0;i<card.data.extensions.risuai.additionalAssets.length;i++){
alertStore.set({
type: 'wait',
msg: `Loading... (Adding Additional Assets ${i} / ${card.data.extensions.risuai.additionalAssets.length})`
type: 'progress',
msg: 'Loading... (Adding Additional Assets)',
submsg: (i / card.data.extensions.risuai.additionalAssets.length * 100).toFixed(2)
})
const key = card.data.extensions.risuai.additionalAssets[i][1]
const rData = await readImage(key)
@@ -1196,8 +1244,9 @@ export async function exportCharacterCard(char:character, type:'png'|'json'|'cha
const keys = Object.keys(char.vits.files)
for(let i=0;i<keys.length;i++){
alertStore.set({
type: 'wait',
msg: `Loading... (Adding VITS ${i} / ${keys.length})`
type: 'progress',
msg: 'Loading... (Adding VITS)',
submsg: (i / keys.length * 100).toFixed(2)
})
const key = keys[i]
const rData = await loadAsset(char.vits.files[key])
@@ -1226,8 +1275,9 @@ export async function exportCharacterCard(char:character, type:'png'|'json'|'cha
if(card.data.assets && card.data.assets.length > 0){
for(let i=0;i<card.data.assets.length;i++){
alertStore.set({
type: 'wait',
msg: `Loading... (Adding Assets ${i} / ${card.data.assets.length})`
type: 'progress',
msg: 'Loading... (Adding Assets)',
submsg: (i / card.data.assets.length * 100).toFixed(2)
})
let key = card.data.assets[i].uri
let rData:Uint8Array

View File

@@ -22,6 +22,7 @@ export enum LLMFlags{
deepSeekPrefix,
deepSeekThinkingInput,
deepSeekThinkingOutput,
noCivilIntegrity
}
export enum LLMProvider{
@@ -874,6 +875,16 @@ export const LLMModels: LLMModel[] = [
tokenizer: LLMTokenizer.GoogleCloud,
recommended: true
},
{
name: "Gemini Flash Lite Preview 2.0 0205",
id: 'gemini-2.0-flash-lite-preview-02-05',
provider: LLMProvider.GoogleCloud,
format: LLMFormat.GoogleCloud,
flags: [LLMFlags.geminiBlockOff,LLMFlags.hasImageInput, LLMFlags.hasFirstSystemPrompt, LLMFlags.poolSupported, LLMFlags.hasAudioInput, LLMFlags.hasVideoInput, LLMFlags.hasStreaming, LLMFlags.requiresAlternateRole, LLMFlags.noCivilIntegrity],
parameters: ['temperature', 'top_k', 'top_p', 'presence_penalty', 'frequency_penalty'],
tokenizer: LLMTokenizer.GoogleCloud,
recommended: true
},
{
name: "Gemini Pro 2.0 Exp 0128",
id: 'gemini-2.0-pro-exp-01-28',
@@ -882,6 +893,15 @@ export const LLMModels: LLMModel[] = [
flags: [LLMFlags.geminiBlockOff,LLMFlags.hasImageInput, LLMFlags.hasFirstSystemPrompt, LLMFlags.poolSupported, LLMFlags.hasAudioInput, LLMFlags.hasVideoInput, LLMFlags.hasStreaming, LLMFlags.requiresAlternateRole],
parameters: ['temperature', 'top_k', 'top_p', 'presence_penalty', 'frequency_penalty'],
tokenizer: LLMTokenizer.GoogleCloud,
},
{
name: "Gemini Pro 2.0 Exp",
id: 'gemini-2.0-pro-exp',
provider: LLMProvider.GoogleCloud,
format: LLMFormat.GoogleCloud,
flags: [LLMFlags.geminiBlockOff,LLMFlags.hasImageInput, LLMFlags.hasFirstSystemPrompt, LLMFlags.poolSupported, LLMFlags.hasAudioInput, LLMFlags.hasVideoInput, LLMFlags.hasStreaming, LLMFlags.requiresAlternateRole, LLMFlags.noCivilIntegrity],
parameters: ['temperature', 'top_k', 'top_p', 'presence_penalty', 'frequency_penalty'],
tokenizer: LLMTokenizer.GoogleCloud,
recommended: true
},
{
@@ -900,7 +920,6 @@ export const LLMModels: LLMModel[] = [
provider: LLMProvider.GoogleCloud,
format: LLMFormat.GoogleCloud,
flags: [LLMFlags.hasImageInput, LLMFlags.hasFirstSystemPrompt, LLMFlags.hasStreaming, LLMFlags.hasStreaming, LLMFlags.requiresAlternateRole],
recommended: true,
parameters: ['temperature', 'top_k', 'top_p'],
tokenizer: LLMTokenizer.GoogleCloud
},
@@ -910,7 +929,6 @@ export const LLMModels: LLMModel[] = [
provider: LLMProvider.GoogleCloud,
format: LLMFormat.GoogleCloud,
flags: [LLMFlags.hasImageInput, LLMFlags.hasFirstSystemPrompt, LLMFlags.hasStreaming, LLMFlags.requiresAlternateRole],
recommended: true,
parameters: ['temperature', 'top_k', 'top_p'],
tokenizer: LLMTokenizer.GoogleCloud
},

View File

@@ -205,9 +205,10 @@ export class CharXReader{
const alertInfo = () => {
if(arg.alertInfo){
alertStore.set({
type: 'wait',
msg: `Loading... (Getting Data: ${Math.floor(pointer / getLength() * 100)}%)`
alertStore.set({
type: 'progress',
msg: `Loading...`,
submsg: (pointer / getLength() * 100).toFixed(2)
})
}
}

View File

@@ -1738,6 +1738,10 @@ async function requestGoogleCloudVertex(arg:RequestDataArgumentExtended):Promise
}
]
if(arg.modelInfo.flags.includes(LLMFlags.noCivilIntegrity)){
uncensoredCatagory.splice(4, 1)
}
if(arg.modelInfo.flags.includes(LLMFlags.geminiBlockOff)){
for(let i=0;i<uncensoredCatagory.length;i++){
uncensoredCatagory[i].threshold = "OFF"

View File

@@ -114,7 +114,6 @@ export class AccountStorage{
}
}
if(da.status === 303){
console.log(performance.now() - perf)
const data = await da.json()
if(data.match){
const c = Buffer.from(await cachedForage.getItem(key))
@@ -144,19 +143,12 @@ export class AccountStorage{
const appendable = new Uint8Array(size)
const reader = da.body.getReader()
//log all headers
console.log('logging headers')
for(const [key, value] of da.headers.entries()){
console.log(key, value)
}
let i = 0
while(true){
const {done, value} = await reader.read()
if(done){
break
}
console.log(value, size)
appendable.set(value, i)
i += value.length
callback(i/size)

View File

@@ -12,7 +12,7 @@ import { defaultColorScheme, type ColorScheme } from '../gui/colorscheme';
import type { PromptItem, PromptSettings } from '../process/prompt';
import type { OobaChatCompletionRequestParams } from '../model/ooba';
export let appVer = "149.0.0"
export let appVer = "149.1.0"
export let webAppSubVer = ''