docs: fix types
This commit is contained in:
@@ -16,6 +16,7 @@ node_modules
|
||||
**/.cache/**
|
||||
**/.vitepress/docsMetadata.json
|
||||
**/.vitepress/cache/
|
||||
**/tsconfig.tsbuildinfo
|
||||
|
||||
**/.netlify/*
|
||||
**/.netlify/functions-serve/*
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
"scripts": {
|
||||
"lint": "eslint --cache .",
|
||||
"lint:fix": "eslint --cache --fix .",
|
||||
"typecheck": "pnpm -r --filter=./packages/* run build",
|
||||
"typecheck": "pnpm -r --filter=./packages/* run typecheck",
|
||||
"dev": "pnpm packages:dev",
|
||||
"build": "pnpm packages:build",
|
||||
"dev:tamagotchi": "pnpm packages:dev:tamagotchi",
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
"dev": "pnpm run stub",
|
||||
"stub": "unbuild --stub",
|
||||
"build": "unbuild",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"package:publish": "pnpm build && pnpm publish --access public --no-git-checks"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"target": "ESNext",
|
||||
"lib": [
|
||||
"ESNext"
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
"dev": "pnpm run stub",
|
||||
"stub": "unbuild --stub",
|
||||
"build": "unbuild",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"package:publish": "pnpm build && pnpm publish --access public --no-git-checks"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"target": "ESNext",
|
||||
"lib": [
|
||||
"ESNext"
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "listhen -w --ws --port 6121 ./src/index.ts",
|
||||
"start": "listhen --ws --port 6121 ./src/index.ts"
|
||||
"start": "listhen --ws --port 6121 ./src/index.ts",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@guiiai/logg": "^1.0.7",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"target": "ESNext",
|
||||
"lib": [
|
||||
"ESNext"
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
"dev": "pnpm run stub",
|
||||
"stub": "unbuild --stub",
|
||||
"build": "unbuild",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"package:publish": "pnpm build && pnpm publish --access public --no-git-checks"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"target": "ESNext",
|
||||
"lib": [
|
||||
"ESNext"
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
"dev": "pnpm run stub",
|
||||
"stub": "unbuild --stub",
|
||||
"build": "unbuild",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"package:publish": "pnpm build && pnpm publish --access public --no-git-checks"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"target": "ESNext",
|
||||
"lib": [
|
||||
"ESNext"
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
"scripts": {
|
||||
"typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false",
|
||||
"typecheck:web": "vue-tsc --noEmit -p tsconfig.web.json --composite false",
|
||||
"typecheck": "npm run typecheck:node && npm run typecheck:web",
|
||||
"typecheck": "pnpm run typecheck:node && pnpm run typecheck:web",
|
||||
"start": "electron-vite preview",
|
||||
"dev": "electron-vite dev",
|
||||
"build": "npm run typecheck && electron-vite build",
|
||||
"build": "pnpm run typecheck && electron-vite build",
|
||||
"postinstall": "electron-builder install-app-deps",
|
||||
"build:unpack": "npm run build && electron-builder --dir",
|
||||
"build:win": "npm run build && electron-builder --win",
|
||||
"build:mac": "npm run build && electron-builder --mac",
|
||||
"build:linux": "npm run build && electron-builder --linux"
|
||||
"build:unpack": "pnpm run build && electron-builder --dir",
|
||||
"build:win": "pnpm run build && electron-builder --win",
|
||||
"build:mac": "pnpm run build && electron-builder --mac",
|
||||
"build:linux": "pnpm run build && electron-builder --linux"
|
||||
},
|
||||
"dependencies": {
|
||||
"@11labs/client": "^0.0.4",
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
"paths": {
|
||||
"@renderer/*": [
|
||||
"src/renderer/src/*"
|
||||
],
|
||||
"@proj-airi/stage-ui/*": [
|
||||
"../stage-ui/src/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
"scripts": {
|
||||
"dev": "pnpm run stub",
|
||||
"stub": "unbuild --stub",
|
||||
"build": "unbuild"
|
||||
"build": "unbuild",
|
||||
"typecheck": "vue-tsc --noEmit"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ async function load() {
|
||||
// input_features: full([1, 80, 3000], 0.0), // for fp32
|
||||
input_features: full([1, 128, 3000], 0.0), // for fp16
|
||||
max_new_tokens: 1,
|
||||
})
|
||||
} as Record<string, unknown>)
|
||||
|
||||
globalThis.postMessage({ status: 'ready' })
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ function calculateVolumeWithLinearNormalize(analyser: AnalyserNode) {
|
||||
const dataBuffer = new Uint8Array(analyser.frequencyBinCount)
|
||||
analyser.getByteFrequencyData(dataBuffer)
|
||||
|
||||
const volumeVector = []
|
||||
const volumeVector: Array<number> = []
|
||||
for (let i = 0; i < 700; i += 80)
|
||||
volumeVector.push(dataBuffer[i])
|
||||
|
||||
@@ -25,7 +25,7 @@ function calculateVolumeWithMinMaxNormalize(analyser: AnalyserNode) {
|
||||
const dataBuffer = new Uint8Array(analyser.frequencyBinCount)
|
||||
analyser.getByteFrequencyData(dataBuffer)
|
||||
|
||||
const volumeVector = []
|
||||
const volumeVector: Array<number> = []
|
||||
for (let i = 0; i < 700; i += 80)
|
||||
volumeVector.push(dataBuffer[i])
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
defer
|
||||
data-domain="airi.ayaka.io"
|
||||
data-api="/api/v1/page-external-data/submit"
|
||||
src="/assets/page-external-data/js/script.js"
|
||||
src="/remote-assets/page-external-data/js/script.js"
|
||||
></script>
|
||||
<script src="/assets/js/CubismSdkForWeb-5-r.1/Core/live2dcubismcore.min.js"></script>
|
||||
</head>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# Proxying Plausible through Netlify | Plausible docs
|
||||
# https://plausible.io/docs/proxy/guides/netlify
|
||||
/assets/page-external-data/js/script.js https://plausible.io/js/script.js 200
|
||||
/remote-assets/page-external-data/js/script.js https://plausible.io/js/script.js 200
|
||||
/api/v1/page-external-data/submit https://plausible.io/api/event 200
|
||||
|
||||
/assets/*
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
import { useSettings } from '@proj-airi/stage-ui/stores/settings'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { RouterView } from 'vue-router'
|
||||
|
||||
const i18n = useI18n()
|
||||
const settings = useSettings()
|
||||
const settings = storeToRefs(useSettings())
|
||||
|
||||
watch(settings.language, () => {
|
||||
i18n.locale = settings.language
|
||||
i18n.locale.value = settings.language.value
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -12,14 +12,6 @@ const messagesProcessed = ref<string[]>([])
|
||||
const emotionsProcessed = ref<string[]>([])
|
||||
const processing = ref<boolean>(false)
|
||||
|
||||
const messageContentQueue = useQueue<string>({
|
||||
handlers: [
|
||||
async (ctx) => {
|
||||
messagesProcessed.value.push(ctx.data)
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
const emotionsQueue = useQueue<Emotion>({
|
||||
handlers: [
|
||||
async (ctx) => {
|
||||
@@ -28,7 +20,7 @@ const emotionsQueue = useQueue<Emotion>({
|
||||
],
|
||||
})
|
||||
|
||||
const emotionMessageContentQueue = useEmotionsMessageQueue(emotionsQueue, messageContentQueue)
|
||||
const emotionMessageContentQueue = useEmotionsMessageQueue(emotionsQueue)
|
||||
|
||||
function onSendMessage() {
|
||||
processing.value = true
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
"ESNext"
|
||||
],
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@proj-airi/stage-ui/*": [
|
||||
"../stage-ui/src/*"
|
||||
]
|
||||
},
|
||||
"resolveJsonModule": true,
|
||||
"types": [
|
||||
"vitest",
|
||||
@@ -17,7 +22,8 @@
|
||||
"unplugin-vue-router/client"
|
||||
],
|
||||
"allowJs": true,
|
||||
"strict": true
|
||||
"strict": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"vueCompilerOptions": {
|
||||
"plugins": [
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"target": "ESNext",
|
||||
"lib": [
|
||||
"ESNext"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"target": "ESNext",
|
||||
"lib": [
|
||||
"ESNext"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/* eslint-disable no-restricted-globals */
|
||||
import type {
|
||||
ModelOutput,
|
||||
PreTrainedModel,
|
||||
PreTrainedTokenizer,
|
||||
Processor,
|
||||
ProgressCallback,
|
||||
Tensor,
|
||||
WhisperModel,
|
||||
} from '@huggingface/transformers'
|
||||
|
||||
import {
|
||||
@@ -25,7 +25,7 @@ class AutomaticSpeechRecognitionPipeline {
|
||||
static model_id: string | null = null
|
||||
static tokenizer: Promise<PreTrainedTokenizer>
|
||||
static processor: Promise<Processor>
|
||||
static model: Promise<PreTrainedModel>
|
||||
static model: Promise<WhisperModel>
|
||||
|
||||
static async getInstance(progress_callback?: ProgressCallback) {
|
||||
this.model_id = 'onnx-community/whisper-base'
|
||||
@@ -45,7 +45,7 @@ class AutomaticSpeechRecognitionPipeline {
|
||||
},
|
||||
device: 'webgpu',
|
||||
progress_callback,
|
||||
})
|
||||
}) as Promise<unknown> as Promise<WhisperModel>
|
||||
|
||||
return Promise.all([this.tokenizer, this.processor, this.model])
|
||||
}
|
||||
@@ -115,8 +115,7 @@ async function load() {
|
||||
})
|
||||
|
||||
// Load the pipeline and save it for future use.
|
||||
// eslint-disable-next-line unused-imports/no-unused-vars
|
||||
const [tokenizer, processor, model] = await AutomaticSpeechRecognitionPipeline.getInstance((x) => {
|
||||
const [_tokenizer, _processor, model] = await AutomaticSpeechRecognitionPipeline.getInstance((x) => {
|
||||
// We also add a progress callback to the pipeline so that we can
|
||||
// track model loading.
|
||||
self.postMessage(x)
|
||||
@@ -131,7 +130,7 @@ async function load() {
|
||||
await model.generate({
|
||||
input_features: full([1, 80, 3000], 0.0),
|
||||
max_new_tokens: 1,
|
||||
})
|
||||
} as Record<string, unknown>)
|
||||
|
||||
self.postMessage({ status: 'ready' })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user