@qvac/sdk 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +57 -331
- package/README.md +2 -2
- package/bare-imports.json +9 -0
- package/dist/client/api/completion-stream.d.ts +2 -1
- package/dist/client/api/completion-stream.js +2 -1
- package/dist/client/api/download-asset.d.ts +3 -2
- package/dist/client/api/download-asset.js +4 -3
- package/dist/client/api/embed.d.ts +5 -2
- package/dist/client/api/embed.js +2 -2
- package/dist/client/api/get-model-info.d.ts +1 -1
- package/dist/client/api/invoke-plugin.d.ts +3 -2
- package/dist/client/api/invoke-plugin.js +4 -4
- package/dist/client/api/load-model.d.ts +12 -10
- package/dist/client/api/load-model.js +3 -3
- package/dist/client/api/rag.d.ts +10 -10
- package/dist/client/api/rag.js +21 -21
- package/dist/client/api/text-to-speech.d.ts +2 -2
- package/dist/client/api/text-to-speech.js +3 -3
- package/dist/client/api/transcribe.d.ts +5 -3
- package/dist/client/api/transcribe.js +6 -4
- package/dist/client/api/translate.d.ts +2 -2
- package/dist/client/api/translate.js +3 -3
- package/dist/client/rpc/node-rpc-client.d.ts +2 -7
- package/dist/client/rpc/node-rpc-client.js +2 -39
- package/dist/client/rpc/profiling/index.d.ts +2 -0
- package/dist/client/rpc/profiling/index.js +1 -0
- package/dist/client/rpc/profiling/profiler.d.ts +27 -0
- package/dist/client/rpc/profiling/profiler.js +139 -0
- package/dist/client/rpc/rpc-client.d.ts +2 -2
- package/dist/client/rpc/rpc-client.js +174 -12
- package/dist/examples/delegated-inference/consumer-profiled.d.ts +2 -0
- package/dist/examples/delegated-inference/consumer-profiled.js +67 -0
- package/dist/examples/llamacpp-multimodal.js +1 -1
- package/dist/examples/parallel-download.js +45 -13
- package/dist/examples/profiling/basic.d.ts +2 -0
- package/dist/examples/profiling/basic.js +71 -0
- package/dist/examples/profiling/per-call.d.ts +2 -0
- package/dist/examples/profiling/per-call.js +30 -0
- package/dist/examples/transcription/parakeet-ctc-filesystem.d.ts +2 -0
- package/dist/examples/transcription/parakeet-ctc-filesystem.js +40 -0
- package/dist/examples/transcription/parakeet-microphone-record.d.ts +2 -0
- package/dist/examples/transcription/parakeet-microphone-record.js +95 -0
- package/dist/examples/transcription/parakeet-sortformer.d.ts +2 -0
- package/dist/examples/transcription/parakeet-sortformer.js +115 -0
- package/dist/examples/transcription/parakeet-tdt-filesystem.d.ts +2 -0
- package/dist/examples/transcription/parakeet-tdt-filesystem.js +44 -0
- package/dist/examples/translation/translation-bergamot-pivot.d.ts +2 -0
- package/dist/examples/translation/translation-bergamot-pivot.js +73 -0
- package/dist/examples/translation/translation-llm-afriquegemma.d.ts +2 -0
- package/dist/examples/translation/translation-llm-afriquegemma.js +39 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -0
- package/dist/logging/index.d.ts +1 -1
- package/dist/logging/index.js +1 -1
- package/dist/logging/namespaces.d.ts +3 -9
- package/dist/logging/namespaces.js +2 -8
- package/dist/logging/registry.js +15 -1
- package/dist/models/registry/models.d.ts +1606 -245
- package/dist/models/registry/models.js +2127 -721
- package/dist/models/update-models/codegen.js +2 -2
- package/dist/models/update-models/history.d.ts +11 -0
- package/dist/models/update-models/history.js +24 -5
- package/dist/models/update-models/index.js +17 -16
- package/dist/models/update-models/naming.js +56 -0
- package/dist/profiling/aggregator.d.ts +15 -0
- package/dist/profiling/aggregator.js +100 -0
- package/dist/profiling/clock.d.ts +12 -0
- package/dist/profiling/clock.js +51 -0
- package/dist/profiling/controller.d.ts +33 -0
- package/dist/profiling/controller.js +123 -0
- package/dist/profiling/envelope.d.ts +10 -0
- package/dist/profiling/envelope.js +36 -0
- package/dist/profiling/events.d.ts +20 -0
- package/dist/profiling/events.js +37 -0
- package/dist/profiling/exporters.d.ts +10 -0
- package/dist/profiling/exporters.js +236 -0
- package/dist/profiling/index.d.ts +36 -0
- package/dist/profiling/index.js +31 -0
- package/dist/profiling/ring-buffer.d.ts +19 -0
- package/dist/profiling/ring-buffer.js +83 -0
- package/dist/profiling/types.d.ts +47 -0
- package/dist/profiling/types.js +1 -0
- package/dist/schemas/common.d.ts +1888 -133
- package/dist/schemas/common.js +2 -0
- package/dist/schemas/completion-stream.d.ts +31 -0
- package/dist/schemas/completion-stream.js +13 -0
- package/dist/schemas/download-asset.d.ts +14 -3
- package/dist/schemas/download-asset.js +3 -1
- package/dist/schemas/engine-addon-map.js +9 -6
- package/dist/schemas/get-model-info.d.ts +2 -0
- package/dist/schemas/get-model-info.js +1 -0
- package/dist/schemas/index.d.ts +2 -1
- package/dist/schemas/index.js +2 -1
- package/dist/schemas/llamacpp-config.d.ts +140 -14
- package/dist/schemas/llamacpp-config.js +11 -7
- package/dist/schemas/load-model.d.ts +9649 -2515
- package/dist/schemas/load-model.js +142 -182
- package/dist/schemas/model-src-utils.d.ts +10 -2
- package/dist/schemas/model-types.d.ts +19 -1
- package/dist/schemas/model-types.js +11 -0
- package/dist/schemas/ocr.d.ts +37 -0
- package/dist/schemas/ocr.js +5 -0
- package/dist/schemas/plugin.d.ts +51 -5
- package/dist/schemas/plugin.js +26 -0
- package/dist/schemas/profiling.d.ts +105 -0
- package/dist/schemas/profiling.js +66 -0
- package/dist/schemas/registry.d.ts +18 -0
- package/dist/schemas/registry.js +2 -0
- package/dist/schemas/reload-config.d.ts +126 -6
- package/dist/schemas/reload-config.js +1 -1
- package/dist/schemas/sdk-config.d.ts +2280 -24
- package/dist/schemas/sdk-config.js +6 -1
- package/dist/schemas/sdk-errors-client.d.ts +1 -0
- package/dist/schemas/sdk-errors-client.js +7 -0
- package/dist/schemas/sdk-errors-server.d.ts +3 -0
- package/dist/schemas/sdk-errors-server.js +15 -0
- package/dist/schemas/text-to-speech.d.ts +90 -68
- package/dist/schemas/text-to-speech.js +16 -33
- package/dist/schemas/transcription-config.d.ts +383 -0
- package/dist/schemas/{whispercpp-config.js → transcription-config.js} +29 -1
- package/dist/schemas/translation-config.d.ts +463 -8
- package/dist/schemas/translation-config.js +35 -2
- package/dist/server/bare/delegate-rpc-client.js +11 -1
- package/dist/server/bare/ops/load-model.d.ts +7 -1
- package/dist/server/bare/ops/load-model.js +41 -42
- package/dist/server/bare/ops/transcribe.d.ts +3 -0
- package/dist/server/bare/ops/transcribe.js +75 -0
- package/dist/server/bare/ops/translate.d.ts +2 -0
- package/dist/server/bare/ops/translate.js +12 -4
- package/dist/server/bare/plugins/index.d.ts +1 -0
- package/dist/server/bare/plugins/index.js +1 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +2 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +8 -6
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +108 -3
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +19 -6
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +32 -2
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +31 -17
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +325 -3
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +117 -10
- package/dist/server/bare/plugins/onnx-ocr/plugin.d.ts +50 -2
- package/dist/server/bare/plugins/onnx-ocr/plugin.js +46 -5
- package/dist/server/bare/plugins/onnx-tts/plugin.d.ts +351 -4
- package/dist/server/bare/plugins/onnx-tts/plugin.js +81 -61
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +317 -0
- package/dist/server/bare/plugins/parakeet-transcription/plugin.js +154 -0
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +209 -3
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +21 -9
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.js +2 -2
- package/dist/server/bare/registry/model-config-utils.js +3 -1
- package/dist/server/bare/utils/audio-input.d.ts +10 -0
- package/dist/server/bare/utils/audio-input.js +33 -0
- package/dist/server/error-handlers.d.ts +3 -2
- package/dist/server/error-handlers.js +11 -8
- package/dist/server/plugins/registry.js +5 -1
- package/dist/server/rpc/delegate-transport.d.ts +11 -3
- package/dist/server/rpc/delegate-transport.js +158 -3
- package/dist/server/rpc/handle-request.js +43 -4
- package/dist/server/rpc/handler-registry.js +7 -1
- package/dist/server/rpc/handler-utils.d.ts +5 -4
- package/dist/server/rpc/handler-utils.js +72 -31
- package/dist/server/rpc/handlers/completion-stream-delegated.d.ts +3 -1
- package/dist/server/rpc/handlers/completion-stream-delegated.js +11 -2
- package/dist/server/rpc/handlers/download-asset.js +55 -3
- package/dist/server/rpc/handlers/load-model/download-stats.d.ts +6 -0
- package/dist/server/rpc/handlers/load-model/download-stats.js +87 -0
- package/dist/server/rpc/handlers/load-model/handler.js +108 -123
- package/dist/server/rpc/handlers/load-model/http.d.ts +2 -1
- package/dist/server/rpc/handlers/load-model/http.js +21 -5
- package/dist/server/rpc/handlers/load-model/hyperdrive.d.ts +2 -1
- package/dist/server/rpc/handlers/load-model/hyperdrive.js +19 -14
- package/dist/server/rpc/handlers/load-model/registry.d.ts +2 -1
- package/dist/server/rpc/handlers/load-model/registry.js +123 -130
- package/dist/server/rpc/handlers/load-model/resolve.d.ts +2 -0
- package/dist/server/rpc/handlers/load-model/resolve.js +55 -22
- package/dist/server/rpc/handlers/load-model/types.d.ts +29 -0
- package/dist/server/rpc/handlers/load-model/types.js +1 -0
- package/dist/server/rpc/handlers/load-model-delegated.d.ts +5 -1
- package/dist/server/rpc/handlers/load-model-delegated.js +35 -7
- package/dist/server/rpc/handlers/plugin-dispatch.js +15 -10
- package/dist/server/rpc/handlers/plugin-invoke.js +56 -51
- package/dist/server/rpc/handlers/rag.js +24 -0
- package/dist/server/rpc/handlers/unload-model-delegated.d.ts +3 -0
- package/dist/server/rpc/handlers/unload-model-delegated.js +32 -0
- package/dist/server/rpc/profiling/context.d.ts +18 -0
- package/dist/server/rpc/profiling/context.js +38 -0
- package/dist/server/rpc/profiling/delegation-profiler.d.ts +32 -0
- package/dist/server/rpc/profiling/delegation-profiler.js +154 -0
- package/dist/server/rpc/profiling/index.d.ts +5 -0
- package/dist/server/rpc/profiling/index.js +4 -0
- package/dist/server/rpc/profiling/operation-metrics.d.ts +25 -0
- package/dist/server/rpc/profiling/operation-metrics.js +199 -0
- package/dist/server/rpc/profiling/operation-wrappers.d.ts +18 -0
- package/dist/server/rpc/profiling/operation-wrappers.js +124 -0
- package/dist/server/rpc/profiling/profiler.d.ts +13 -0
- package/dist/server/rpc/profiling/profiler.js +97 -0
- package/dist/server/utils/cache.d.ts +2 -1
- package/dist/server/utils/cache.js +5 -1
- package/dist/server/utils/checksum.d.ts +2 -0
- package/dist/server/utils/checksum.js +7 -0
- package/dist/server/utils/formatting.d.ts +6 -0
- package/dist/server/utils/formatting.js +35 -0
- package/dist/server/worker.js +2 -1
- package/dist/utils/errors-client.d.ts +3 -0
- package/dist/utils/errors-client.js +6 -0
- package/dist/utils/errors-server.d.ts +9 -0
- package/dist/utils/errors-server.js +15 -0
- package/dist/utils/global-singleton.d.ts +2 -0
- package/dist/utils/global-singleton.js +10 -0
- package/package.json +14 -17
- package/dist/schemas/whispercpp-config.d.ts +0 -70
- package/dist/server/bare/plugins/whispercpp-transcription/ops/transcribe-stream.d.ts +0 -3
- package/dist/server/bare/plugins/whispercpp-transcription/ops/transcribe-stream.js +0 -81
- /package/dist/examples/{whispercpp-filesystem.d.ts → transcription/whispercpp-filesystem.d.ts} +0 -0
- /package/dist/examples/{whispercpp-filesystem.js → transcription/whispercpp-filesystem.js} +0 -0
- /package/dist/examples/{whispercpp-microphone-record.d.ts → transcription/whispercpp-microphone-record.d.ts} +0 -0
- /package/dist/examples/{whispercpp-microphone-record.js → transcription/whispercpp-microphone-record.js} +0 -0
- /package/dist/examples/{whispercpp-prompt.d.ts → transcription/whispercpp-prompt.d.ts} +0 -0
- /package/dist/examples/{whispercpp-prompt.js → transcription/whispercpp-prompt.js} +0 -0
|
@@ -1,9 +1,356 @@
|
|
|
1
|
-
import { type CreateModelParams, type PluginModelResult, type
|
|
1
|
+
import { type CreateModelParams, type PluginModelResult, type ResolveContext, type TtsChatterboxRuntimeConfig, type TtsSupertonicRuntimeConfig } from "../../../../schemas/index";
|
|
2
2
|
export declare const ttsPlugin: {
|
|
3
3
|
modelType: "onnx-tts";
|
|
4
4
|
displayName: string;
|
|
5
|
-
addonPackage:
|
|
6
|
-
|
|
5
|
+
addonPackage: "@qvac/tts-onnx";
|
|
6
|
+
loadConfigSchema: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
7
|
+
ttsEngine: import("zod").ZodLiteral<"chatterbox">;
|
|
8
|
+
language: import("zod").ZodEnum<{
|
|
9
|
+
en: "en";
|
|
10
|
+
de: "de";
|
|
11
|
+
es: "es";
|
|
12
|
+
it: "it";
|
|
13
|
+
}>;
|
|
14
|
+
ttsTokenizerSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
15
|
+
src: import("zod").ZodString;
|
|
16
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
17
|
+
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
18
|
+
registryPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
19
|
+
registrySource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
20
|
+
blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
21
|
+
blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
22
|
+
engine: import("zod").ZodOptional<import("zod").ZodString>;
|
|
23
|
+
expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
24
|
+
sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
|
|
25
|
+
addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
26
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
27
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
28
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
29
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
30
|
+
"onnx-tts": "onnx-tts";
|
|
31
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
32
|
+
"onnx-ocr": "onnx-ocr";
|
|
33
|
+
llm: "llm";
|
|
34
|
+
whisper: "whisper";
|
|
35
|
+
embeddings: "embeddings";
|
|
36
|
+
nmt: "nmt";
|
|
37
|
+
parakeet: "parakeet";
|
|
38
|
+
tts: "tts";
|
|
39
|
+
ocr: "ocr";
|
|
40
|
+
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
41
|
+
}, import("zod/v4/core").$strip>]>;
|
|
42
|
+
ttsSpeechEncoderSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
43
|
+
src: import("zod").ZodString;
|
|
44
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
45
|
+
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
46
|
+
registryPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
47
|
+
registrySource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
48
|
+
blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
49
|
+
blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
50
|
+
engine: import("zod").ZodOptional<import("zod").ZodString>;
|
|
51
|
+
expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
52
|
+
sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
|
|
53
|
+
addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
54
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
55
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
56
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
57
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
58
|
+
"onnx-tts": "onnx-tts";
|
|
59
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
60
|
+
"onnx-ocr": "onnx-ocr";
|
|
61
|
+
llm: "llm";
|
|
62
|
+
whisper: "whisper";
|
|
63
|
+
embeddings: "embeddings";
|
|
64
|
+
nmt: "nmt";
|
|
65
|
+
parakeet: "parakeet";
|
|
66
|
+
tts: "tts";
|
|
67
|
+
ocr: "ocr";
|
|
68
|
+
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
69
|
+
}, import("zod/v4/core").$strip>]>;
|
|
70
|
+
ttsEmbedTokensSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
71
|
+
src: import("zod").ZodString;
|
|
72
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
73
|
+
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
74
|
+
registryPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
75
|
+
registrySource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
76
|
+
blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
77
|
+
blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
78
|
+
engine: import("zod").ZodOptional<import("zod").ZodString>;
|
|
79
|
+
expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
80
|
+
sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
|
|
81
|
+
addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
82
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
83
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
84
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
85
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
86
|
+
"onnx-tts": "onnx-tts";
|
|
87
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
88
|
+
"onnx-ocr": "onnx-ocr";
|
|
89
|
+
llm: "llm";
|
|
90
|
+
whisper: "whisper";
|
|
91
|
+
embeddings: "embeddings";
|
|
92
|
+
nmt: "nmt";
|
|
93
|
+
parakeet: "parakeet";
|
|
94
|
+
tts: "tts";
|
|
95
|
+
ocr: "ocr";
|
|
96
|
+
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
97
|
+
}, import("zod/v4/core").$strip>]>;
|
|
98
|
+
ttsConditionalDecoderSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
99
|
+
src: import("zod").ZodString;
|
|
100
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
101
|
+
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
102
|
+
registryPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
103
|
+
registrySource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
104
|
+
blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
105
|
+
blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
106
|
+
engine: import("zod").ZodOptional<import("zod").ZodString>;
|
|
107
|
+
expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
108
|
+
sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
|
|
109
|
+
addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
110
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
111
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
112
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
113
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
114
|
+
"onnx-tts": "onnx-tts";
|
|
115
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
116
|
+
"onnx-ocr": "onnx-ocr";
|
|
117
|
+
llm: "llm";
|
|
118
|
+
whisper: "whisper";
|
|
119
|
+
embeddings: "embeddings";
|
|
120
|
+
nmt: "nmt";
|
|
121
|
+
parakeet: "parakeet";
|
|
122
|
+
tts: "tts";
|
|
123
|
+
ocr: "ocr";
|
|
124
|
+
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
125
|
+
}, import("zod/v4/core").$strip>]>;
|
|
126
|
+
ttsLanguageModelSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
127
|
+
src: import("zod").ZodString;
|
|
128
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
129
|
+
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
130
|
+
registryPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
131
|
+
registrySource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
132
|
+
blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
133
|
+
blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
134
|
+
engine: import("zod").ZodOptional<import("zod").ZodString>;
|
|
135
|
+
expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
136
|
+
sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
|
|
137
|
+
addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
138
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
139
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
140
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
141
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
142
|
+
"onnx-tts": "onnx-tts";
|
|
143
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
144
|
+
"onnx-ocr": "onnx-ocr";
|
|
145
|
+
llm: "llm";
|
|
146
|
+
whisper: "whisper";
|
|
147
|
+
embeddings: "embeddings";
|
|
148
|
+
nmt: "nmt";
|
|
149
|
+
parakeet: "parakeet";
|
|
150
|
+
tts: "tts";
|
|
151
|
+
ocr: "ocr";
|
|
152
|
+
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
153
|
+
}, import("zod/v4/core").$strip>]>;
|
|
154
|
+
referenceAudioSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
155
|
+
src: import("zod").ZodString;
|
|
156
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
157
|
+
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
158
|
+
registryPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
159
|
+
registrySource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
160
|
+
blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
161
|
+
blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
162
|
+
engine: import("zod").ZodOptional<import("zod").ZodString>;
|
|
163
|
+
expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
164
|
+
sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
|
|
165
|
+
addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
166
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
167
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
168
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
169
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
170
|
+
"onnx-tts": "onnx-tts";
|
|
171
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
172
|
+
"onnx-ocr": "onnx-ocr";
|
|
173
|
+
llm: "llm";
|
|
174
|
+
whisper: "whisper";
|
|
175
|
+
embeddings: "embeddings";
|
|
176
|
+
nmt: "nmt";
|
|
177
|
+
parakeet: "parakeet";
|
|
178
|
+
tts: "tts";
|
|
179
|
+
ocr: "ocr";
|
|
180
|
+
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
181
|
+
}, import("zod/v4/core").$strip>]>;
|
|
182
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
183
|
+
ttsEngine: import("zod").ZodLiteral<"supertonic">;
|
|
184
|
+
language: import("zod").ZodEnum<{
|
|
185
|
+
en: "en";
|
|
186
|
+
de: "de";
|
|
187
|
+
es: "es";
|
|
188
|
+
it: "it";
|
|
189
|
+
}>;
|
|
190
|
+
ttsSpeed: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
191
|
+
ttsNumInferenceSteps: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
192
|
+
ttsTokenizerSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
193
|
+
src: import("zod").ZodString;
|
|
194
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
195
|
+
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
196
|
+
registryPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
197
|
+
registrySource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
198
|
+
blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
199
|
+
blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
200
|
+
engine: import("zod").ZodOptional<import("zod").ZodString>;
|
|
201
|
+
expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
202
|
+
sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
|
|
203
|
+
addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
204
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
205
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
206
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
207
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
208
|
+
"onnx-tts": "onnx-tts";
|
|
209
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
210
|
+
"onnx-ocr": "onnx-ocr";
|
|
211
|
+
llm: "llm";
|
|
212
|
+
whisper: "whisper";
|
|
213
|
+
embeddings: "embeddings";
|
|
214
|
+
nmt: "nmt";
|
|
215
|
+
parakeet: "parakeet";
|
|
216
|
+
tts: "tts";
|
|
217
|
+
ocr: "ocr";
|
|
218
|
+
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
219
|
+
}, import("zod/v4/core").$strip>]>;
|
|
220
|
+
ttsTextEncoderSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
221
|
+
src: import("zod").ZodString;
|
|
222
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
223
|
+
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
224
|
+
registryPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
225
|
+
registrySource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
226
|
+
blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
227
|
+
blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
228
|
+
engine: import("zod").ZodOptional<import("zod").ZodString>;
|
|
229
|
+
expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
230
|
+
sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
|
|
231
|
+
addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
232
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
233
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
234
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
235
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
236
|
+
"onnx-tts": "onnx-tts";
|
|
237
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
238
|
+
"onnx-ocr": "onnx-ocr";
|
|
239
|
+
llm: "llm";
|
|
240
|
+
whisper: "whisper";
|
|
241
|
+
embeddings: "embeddings";
|
|
242
|
+
nmt: "nmt";
|
|
243
|
+
parakeet: "parakeet";
|
|
244
|
+
tts: "tts";
|
|
245
|
+
ocr: "ocr";
|
|
246
|
+
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
247
|
+
}, import("zod/v4/core").$strip>]>;
|
|
248
|
+
ttsLatentDenoiserSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
249
|
+
src: import("zod").ZodString;
|
|
250
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
251
|
+
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
252
|
+
registryPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
253
|
+
registrySource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
254
|
+
blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
255
|
+
blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
256
|
+
engine: import("zod").ZodOptional<import("zod").ZodString>;
|
|
257
|
+
expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
258
|
+
sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
|
|
259
|
+
addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
260
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
261
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
262
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
263
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
264
|
+
"onnx-tts": "onnx-tts";
|
|
265
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
266
|
+
"onnx-ocr": "onnx-ocr";
|
|
267
|
+
llm: "llm";
|
|
268
|
+
whisper: "whisper";
|
|
269
|
+
embeddings: "embeddings";
|
|
270
|
+
nmt: "nmt";
|
|
271
|
+
parakeet: "parakeet";
|
|
272
|
+
tts: "tts";
|
|
273
|
+
ocr: "ocr";
|
|
274
|
+
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
275
|
+
}, import("zod/v4/core").$strip>]>;
|
|
276
|
+
ttsVoiceDecoderSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
277
|
+
src: import("zod").ZodString;
|
|
278
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
279
|
+
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
280
|
+
registryPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
281
|
+
registrySource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
282
|
+
blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
283
|
+
blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
284
|
+
engine: import("zod").ZodOptional<import("zod").ZodString>;
|
|
285
|
+
expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
286
|
+
sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
|
|
287
|
+
addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
288
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
289
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
290
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
291
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
292
|
+
"onnx-tts": "onnx-tts";
|
|
293
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
294
|
+
"onnx-ocr": "onnx-ocr";
|
|
295
|
+
llm: "llm";
|
|
296
|
+
whisper: "whisper";
|
|
297
|
+
embeddings: "embeddings";
|
|
298
|
+
nmt: "nmt";
|
|
299
|
+
parakeet: "parakeet";
|
|
300
|
+
tts: "tts";
|
|
301
|
+
ocr: "ocr";
|
|
302
|
+
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
303
|
+
}, import("zod/v4/core").$strip>]>;
|
|
304
|
+
ttsVoiceSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
305
|
+
src: import("zod").ZodString;
|
|
306
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
307
|
+
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
308
|
+
registryPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
309
|
+
registrySource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
310
|
+
blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
311
|
+
blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
312
|
+
engine: import("zod").ZodOptional<import("zod").ZodString>;
|
|
313
|
+
expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
314
|
+
sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
|
|
315
|
+
addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
316
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
317
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
318
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
319
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
320
|
+
"onnx-tts": "onnx-tts";
|
|
321
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
322
|
+
"onnx-ocr": "onnx-ocr";
|
|
323
|
+
llm: "llm";
|
|
324
|
+
whisper: "whisper";
|
|
325
|
+
embeddings: "embeddings";
|
|
326
|
+
nmt: "nmt";
|
|
327
|
+
parakeet: "parakeet";
|
|
328
|
+
tts: "tts";
|
|
329
|
+
ocr: "ocr";
|
|
330
|
+
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
331
|
+
}, import("zod/v4/core").$strip>]>;
|
|
332
|
+
}, import("zod/v4/core").$strip>]>;
|
|
333
|
+
skipPrimaryModelPathValidation: true;
|
|
334
|
+
resolveConfig(cfg: Record<string, unknown>, ctx: ResolveContext): Promise<{
|
|
335
|
+
config: TtsChatterboxRuntimeConfig;
|
|
336
|
+
artifacts: {
|
|
337
|
+
tokenizerPath: string;
|
|
338
|
+
speechEncoderPath: string;
|
|
339
|
+
embedTokensPath: string;
|
|
340
|
+
conditionalDecoderPath: string;
|
|
341
|
+
languageModelPath: string;
|
|
342
|
+
referenceAudioPath: string;
|
|
343
|
+
};
|
|
344
|
+
} | {
|
|
345
|
+
config: TtsSupertonicRuntimeConfig;
|
|
346
|
+
artifacts: {
|
|
347
|
+
tokenizerPath: string;
|
|
348
|
+
textEncoderPath: string;
|
|
349
|
+
latentDenoiserPath: string;
|
|
350
|
+
voiceDecoderPath: string;
|
|
351
|
+
voicePath: string;
|
|
352
|
+
};
|
|
353
|
+
}>;
|
|
7
354
|
createModel(params: CreateModelParams): PluginModelResult;
|
|
8
355
|
handlers: {
|
|
9
356
|
textToSpeech: import("../../../../schemas/index").PluginHandlerDefinition<import("zod").ZodObject<{
|
|
@@ -20,7 +367,7 @@ export declare const ttsPlugin: {
|
|
|
20
367
|
};
|
|
21
368
|
logging: {
|
|
22
369
|
module: import("@qvac/tts-onnx/addonLogging").AddonLogging;
|
|
23
|
-
namespace: "tts";
|
|
370
|
+
namespace: "onnx-tts";
|
|
24
371
|
};
|
|
25
372
|
};
|
|
26
373
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import path from "bare-path";
|
|
2
2
|
import ttsAddonLogging from "@qvac/tts-onnx/addonLogging.js";
|
|
3
3
|
import ONNXTTS from "@qvac/tts-onnx";
|
|
4
|
-
import { definePlugin, defineHandler, ttsRequestSchema, ttsResponseSchema, ModelType, } from "../../../../schemas/index.js";
|
|
5
|
-
import {
|
|
4
|
+
import { definePlugin, defineHandler, ttsRequestSchema, ttsResponseSchema, ModelType, ttsConfigSchema, ADDON_TTS, } from "../../../../schemas/index.js";
|
|
5
|
+
import { createStreamLogger, registerAddonLogger } from "../../../../logging/index.js";
|
|
6
6
|
import { TtsArtifactsRequiredError, TtsReferenceAudioRequiredError, } from "../../../../utils/errors-server.js";
|
|
7
7
|
import { textToSpeech } from "./ops/text-to-speech.js";
|
|
8
8
|
import { loadReferenceAudioAt24k } from "./wav-helper.js";
|
|
9
|
-
async function resolveChatterboxConfig(config,
|
|
9
|
+
async function resolveChatterboxConfig(config, ctx) {
|
|
10
10
|
const { ttsTokenizerSrc, ttsSpeechEncoderSrc, ttsEmbedTokensSrc, ttsConditionalDecoderSrc, ttsLanguageModelSrc, referenceAudioSrc, language, } = config;
|
|
11
11
|
if (!ttsTokenizerSrc ||
|
|
12
12
|
!ttsSpeechEncoderSrc ||
|
|
@@ -18,27 +18,31 @@ async function resolveChatterboxConfig(config, resolve) {
|
|
|
18
18
|
if (!referenceAudioSrc) {
|
|
19
19
|
throw new TtsReferenceAudioRequiredError();
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
21
|
+
const resolve = ctx.resolveModelPath;
|
|
22
|
+
const [tokenizerPath, speechEncoderPath, embedTokensPath, conditionalDecoderPath, languageModelPath, referenceAudioPath,] = await Promise.all([
|
|
23
|
+
resolve(ttsTokenizerSrc),
|
|
24
|
+
resolve(ttsSpeechEncoderSrc),
|
|
25
|
+
resolve(ttsEmbedTokensSrc),
|
|
26
|
+
resolve(ttsConditionalDecoderSrc),
|
|
27
|
+
resolve(ttsLanguageModelSrc),
|
|
28
|
+
resolve(referenceAudioSrc),
|
|
29
|
+
]);
|
|
30
|
+
return {
|
|
31
|
+
config: {
|
|
32
|
+
ttsEngine: "chatterbox",
|
|
33
|
+
language,
|
|
34
|
+
},
|
|
35
|
+
artifacts: {
|
|
36
|
+
tokenizerPath,
|
|
37
|
+
speechEncoderPath,
|
|
38
|
+
embedTokensPath,
|
|
39
|
+
conditionalDecoderPath,
|
|
40
|
+
languageModelPath,
|
|
41
|
+
referenceAudioPath,
|
|
42
|
+
},
|
|
36
43
|
};
|
|
37
|
-
if (language)
|
|
38
|
-
result.language = language;
|
|
39
|
-
return result;
|
|
40
44
|
}
|
|
41
|
-
async function resolveSupertonicConfig(config,
|
|
45
|
+
async function resolveSupertonicConfig(config, ctx) {
|
|
42
46
|
const { ttsTokenizerSrc, ttsTextEncoderSrc, ttsLatentDenoiserSrc, ttsVoiceDecoderSrc, ttsVoiceSrc, ttsSpeed, ttsNumInferenceSteps, language, } = config;
|
|
43
47
|
if (!ttsTokenizerSrc ||
|
|
44
48
|
!ttsTextEncoderSrc ||
|
|
@@ -47,30 +51,37 @@ async function resolveSupertonicConfig(config, resolve) {
|
|
|
47
51
|
!ttsVoiceSrc) {
|
|
48
52
|
throw new TtsArtifactsRequiredError();
|
|
49
53
|
}
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
const resolve = ctx.resolveModelPath;
|
|
55
|
+
const [tokenizerPath, textEncoderPath, latentDenoiserPath, voiceDecoderPath, voicePath,] = await Promise.all([
|
|
56
|
+
resolve(ttsTokenizerSrc),
|
|
57
|
+
resolve(ttsTextEncoderSrc),
|
|
58
|
+
resolve(ttsLatentDenoiserSrc),
|
|
59
|
+
resolve(ttsVoiceDecoderSrc),
|
|
60
|
+
resolve(ttsVoiceSrc),
|
|
61
|
+
]);
|
|
62
|
+
return {
|
|
63
|
+
config: {
|
|
64
|
+
ttsEngine: "supertonic",
|
|
65
|
+
language,
|
|
66
|
+
ttsSpeed,
|
|
67
|
+
ttsNumInferenceSteps,
|
|
68
|
+
},
|
|
69
|
+
artifacts: {
|
|
70
|
+
tokenizerPath,
|
|
71
|
+
textEncoderPath,
|
|
72
|
+
latentDenoiserPath,
|
|
73
|
+
voiceDecoderPath,
|
|
74
|
+
voicePath,
|
|
75
|
+
},
|
|
63
76
|
};
|
|
64
|
-
if (language)
|
|
65
|
-
result.language = language;
|
|
66
|
-
if (ttsSpeed !== undefined)
|
|
67
|
-
result.ttsSpeed = ttsSpeed;
|
|
68
|
-
if (ttsNumInferenceSteps !== undefined)
|
|
69
|
-
result.ttsNumInferenceSteps = ttsNumInferenceSteps;
|
|
70
|
-
return result;
|
|
71
77
|
}
|
|
72
|
-
function createChatterboxModel(modelId, config) {
|
|
73
|
-
const
|
|
78
|
+
function createChatterboxModel(modelId, config, artifacts) {
|
|
79
|
+
const tokenizerPath = artifacts["tokenizerPath"];
|
|
80
|
+
const speechEncoderPath = artifacts["speechEncoderPath"];
|
|
81
|
+
const embedTokensPath = artifacts["embedTokensPath"];
|
|
82
|
+
const conditionalDecoderPath = artifacts["conditionalDecoderPath"];
|
|
83
|
+
const languageModelPath = artifacts["languageModelPath"];
|
|
84
|
+
const referenceAudioPath = artifacts["referenceAudioPath"];
|
|
74
85
|
if (!tokenizerPath ||
|
|
75
86
|
!speechEncoderPath ||
|
|
76
87
|
!embedTokensPath ||
|
|
@@ -81,7 +92,8 @@ function createChatterboxModel(modelId, config) {
|
|
|
81
92
|
if (!referenceAudioPath) {
|
|
82
93
|
throw new TtsReferenceAudioRequiredError();
|
|
83
94
|
}
|
|
84
|
-
const logger = createStreamLogger(modelId,
|
|
95
|
+
const logger = createStreamLogger(modelId, ModelType.onnxTts);
|
|
96
|
+
registerAddonLogger(modelId, ModelType.onnxTts, logger);
|
|
85
97
|
const referenceAudio = loadReferenceAudioAt24k(referenceAudioPath);
|
|
86
98
|
const args = {
|
|
87
99
|
tokenizerPath,
|
|
@@ -93,12 +105,16 @@ function createChatterboxModel(modelId, config) {
|
|
|
93
105
|
logger,
|
|
94
106
|
opts: { stats: true },
|
|
95
107
|
};
|
|
96
|
-
const modelConfig = { language: language ?? "en", useGPU: false };
|
|
108
|
+
const modelConfig = { language: config.language ?? "en", useGPU: false };
|
|
97
109
|
const model = new ONNXTTS(args, modelConfig);
|
|
98
110
|
return { model, loader: undefined };
|
|
99
111
|
}
|
|
100
|
-
function createSupertonicModel(modelId, config) {
|
|
101
|
-
const
|
|
112
|
+
function createSupertonicModel(modelId, config, artifacts) {
|
|
113
|
+
const tokenizerPath = artifacts["tokenizerPath"];
|
|
114
|
+
const textEncoderPath = artifacts["textEncoderPath"];
|
|
115
|
+
const latentDenoiserPath = artifacts["latentDenoiserPath"];
|
|
116
|
+
const voiceDecoderPath = artifacts["voiceDecoderPath"];
|
|
117
|
+
const voicePath = artifacts["voicePath"];
|
|
102
118
|
if (!tokenizerPath ||
|
|
103
119
|
!textEncoderPath ||
|
|
104
120
|
!latentDenoiserPath ||
|
|
@@ -106,7 +122,8 @@ function createSupertonicModel(modelId, config) {
|
|
|
106
122
|
!voicePath) {
|
|
107
123
|
throw new TtsArtifactsRequiredError();
|
|
108
124
|
}
|
|
109
|
-
const logger = createStreamLogger(modelId,
|
|
125
|
+
const logger = createStreamLogger(modelId, ModelType.onnxTts);
|
|
126
|
+
registerAddonLogger(modelId, ModelType.onnxTts, logger);
|
|
110
127
|
const voicesDir = path.dirname(voicePath);
|
|
111
128
|
const voiceName = path.basename(voicePath).replace(/\.bin$/i, "") || "voice";
|
|
112
129
|
const args = {
|
|
@@ -116,32 +133,35 @@ function createSupertonicModel(modelId, config) {
|
|
|
116
133
|
voiceDecoderPath,
|
|
117
134
|
voicesDir,
|
|
118
135
|
voiceName,
|
|
119
|
-
speed:
|
|
120
|
-
numInferenceSteps:
|
|
136
|
+
speed: config.ttsSpeed ?? 1,
|
|
137
|
+
numInferenceSteps: config.ttsNumInferenceSteps ?? 5,
|
|
121
138
|
logger,
|
|
122
139
|
opts: { stats: true },
|
|
123
140
|
};
|
|
124
|
-
const modelConfig = { language: language ?? "en" };
|
|
141
|
+
const modelConfig = { language: config.language ?? "en" };
|
|
125
142
|
const model = new ONNXTTS(args, modelConfig);
|
|
126
143
|
return { model, loader: undefined };
|
|
127
144
|
}
|
|
128
145
|
export const ttsPlugin = definePlugin({
|
|
129
146
|
modelType: ModelType.onnxTts,
|
|
130
147
|
displayName: "TTS (ONNX)",
|
|
131
|
-
addonPackage:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
148
|
+
addonPackage: ADDON_TTS,
|
|
149
|
+
loadConfigSchema: ttsConfigSchema,
|
|
150
|
+
skipPrimaryModelPathValidation: true,
|
|
151
|
+
async resolveConfig(cfg, ctx) {
|
|
152
|
+
const { ttsEngine } = cfg;
|
|
153
|
+
if (ttsEngine === "supertonic") {
|
|
154
|
+
return resolveSupertonicConfig(cfg, ctx);
|
|
136
155
|
}
|
|
137
|
-
return resolveChatterboxConfig(
|
|
156
|
+
return resolveChatterboxConfig(cfg, ctx);
|
|
138
157
|
},
|
|
139
158
|
createModel(params) {
|
|
140
159
|
const config = (params.modelConfig ?? {});
|
|
160
|
+
const artifacts = params.artifacts ?? {};
|
|
141
161
|
if (config.ttsEngine === "supertonic") {
|
|
142
|
-
return createSupertonicModel(params.modelId, config);
|
|
162
|
+
return createSupertonicModel(params.modelId, config, artifacts);
|
|
143
163
|
}
|
|
144
|
-
return createChatterboxModel(params.modelId, config);
|
|
164
|
+
return createChatterboxModel(params.modelId, config, artifacts);
|
|
145
165
|
},
|
|
146
166
|
handlers: {
|
|
147
167
|
textToSpeech: defineHandler({
|
|
@@ -157,6 +177,6 @@ export const ttsPlugin = definePlugin({
|
|
|
157
177
|
},
|
|
158
178
|
logging: {
|
|
159
179
|
module: ttsAddonLogging,
|
|
160
|
-
namespace:
|
|
180
|
+
namespace: ModelType.onnxTts,
|
|
161
181
|
},
|
|
162
182
|
});
|