sovits-v2-api
Version:
GPT-SoVITS v2 api
54 lines (53 loc) • 3.06 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseConfig = void 0;
const koishi_1 = require("koishi");
exports.BaseConfig = koishi_1.Schema.intersect([
koishi_1.Schema.object({
defaultEngine: koishi_1.Schema.const('GPT-SOVITS').description('默认引擎'),
max_length: koishi_1.Schema.number().default(256).description('最大长度'),
}).description("基础配置"),
koishi_1.Schema.object({
endpoint: koishi_1.Schema.string().default('http://host.docker.internal:9880/').description('VITS 服务器地址'),
models: koishi_1.Schema.array(koishi_1.Schema.object({
model_name: koishi_1.Schema.string().description('模型名称'),
gpt_model_path: koishi_1.Schema.string().description('GPT 模型文件路径'),
sovits_model_path: koishi_1.Schema.string().description('SOVITS 模型文件路径'),
reference_audio: koishi_1.Schema.string().description('参考音频路径'),
text_prompt: koishi_1.Schema.string().description('参考音频文本'),
text_prompt_lang: koishi_1.Schema.union([
koishi_1.Schema.const('zh'),
koishi_1.Schema.const('en'),
koishi_1.Schema.const('jp'),
]).default('zh').description('参考音频文本语言'),
}).role('table')).default([]).description('模型配置列表'),
}).description('GPT-SOVITS API 配置'),
koishi_1.Schema.object({
format: koishi_1.Schema.union([
koishi_1.Schema.const('ogg'),
koishi_1.Schema.const('wav'),
koishi_1.Schema.const('amr'),
koishi_1.Schema.const('mp3'),
]).default('mp3').description('生成音频格式'),
default_lang: koishi_1.Schema.union([
koishi_1.Schema.const('zh'),
koishi_1.Schema.const('en'),
koishi_1.Schema.const('jp'),
]).default('zh').description('默认生成音频语言,-lang 参数的回落值'),
speech_length: koishi_1.Schema.number().role('slider').min(0).max(2).step(0.1).default(1.4).description('语速, 越大越慢'),
cut_punc: koishi_1.Schema.string().default(',,.。!!??').description('分割符'),
top_k: koishi_1.Schema.number().default(15).description(''),
top_p: koishi_1.Schema.number().default(1).description(''),
temperature: koishi_1.Schema.number().default(1).description(''),
}).description("参数设置"),
koishi_1.Schema.object({
waiting: koishi_1.Schema.boolean().default(true).description('消息反馈,会发送思考中...'),
recall: koishi_1.Schema.boolean().default(true).description('会撤回思考中'),
recall_time: koishi_1.Schema.number().default(5000).description('撤回的时间'),
}).description("拓展设置"),
koishi_1.Schema.object({
enable_parallel: koishi_1.Schema.boolean()
.default(false)
.description('启用并行推理(需要 GPU 支持)')
})
]);