|
@@ -1,7 +1,6 @@
|
|
|
<script lang="ts">
|
|
|
import { toast } from 'svelte-sonner';
|
|
|
import { createEventDispatcher, onMount, getContext } from 'svelte';
|
|
|
- import { KokoroTTS } from 'kokoro-js';
|
|
|
|
|
|
import { user, settings, config } from '$lib/stores';
|
|
|
import { getVoices as _getVoices } from '$lib/apis/audio';
|
|
@@ -128,6 +127,7 @@
|
|
|
|
|
|
const model_id = 'onnx-community/Kokoro-82M-v1.0-ONNX';
|
|
|
|
|
|
+ const { KokoroTTS } = await import('kokoro-js');
|
|
|
TTSModel = await KokoroTTS.from_pretrained(model_id, {
|
|
|
dtype: TTSEngineConfig.dtype, // Options: "fp32", "fp16", "q8", "q4", "q4f16"
|
|
|
device: !!navigator?.gpu ? 'webgpu' : 'wasm', // Detect WebGPU
|