@qvac/tts-ggml 0.11.0 → 0.12.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/README.md +61 -21
- package/addon-unavailable.js +12 -28
- package/binding.js +1 -52
- package/index.d.ts +5 -3
- package/index.js +1 -3
- package/lib/fit.js +2 -8
- package/package.json +35 -41
- package/lib/backends.d.ts +0 -10
- package/lib/backends.js +0 -76
package/README.md
CHANGED
|
@@ -49,12 +49,14 @@ validated on Apple/Metal.
|
|
|
49
49
|
`config.useGPU: true` on GPU-capable hosts — including Android, where
|
|
50
50
|
`tts-cpp` selects the GPU backend per its per-vendor allowlist (see
|
|
51
51
|
[Backends & GPU acceleration](#backends--gpu-acceleration)).
|
|
52
|
-
- **Apple Core ML sidecars** for the Supertonic vocoder
|
|
53
|
-
|
|
52
|
+
- **Apple Core ML sidecars** for the Supertonic vocoder, the Audio8 codec,
|
|
53
|
+
and one stage each of MOSS, MOSS-SoundEffect, and MOSS-Speech on macOS /
|
|
54
|
+
iOS, picked up when staged next to the model (see
|
|
54
55
|
[Core ML sidecars on Apple](#core-ml-sidecars-on-apple)).
|
|
55
56
|
- **Dynamic backend loading on Android** — per-arch CPU + Vulkan +
|
|
56
|
-
OpenCL `.so` files ship under
|
|
57
|
-
and
|
|
57
|
+
OpenCL `.so` files ship under
|
|
58
|
+
`prebuilds/<bare-target>/qvac__tts-ggml-android-arm64/` and the addon picks
|
|
59
|
+
them up at runtime from next to its native module (see
|
|
58
60
|
[Backends & GPU acceleration](#backends--gpu-acceleration)).
|
|
59
61
|
- **Cancellation** via `model.cancel()` — stops T3 decode on the next
|
|
60
62
|
token; in-flight S3Gen chunk runs to completion.
|
|
@@ -149,11 +151,10 @@ package selected at install time through `os`/`cpu` filtered
|
|
|
149
151
|
|
|
150
152
|
Do not depend on desktop platform packages directly. Supported installers are
|
|
151
153
|
npm 7+, pnpm, bun, and Yarn Berry. Yarn v1 and `--omit=optional` installs skip
|
|
152
|
-
the platform package and fail at require time
|
|
153
|
-
package
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
loaded ggml backends. Unsupported targets must
|
|
154
|
+
the platform package and fail at require time, and at `bare-pack` time, naming
|
|
155
|
+
the missing package. Each platform package is an ordinary Bare addon whose
|
|
156
|
+
`prebuilds/<host>/` holds the native module and, next to it, the dynamically
|
|
157
|
+
loaded ggml backends the module finds on its own. Unsupported targets must
|
|
157
158
|
[build from source](#build-from-source); installation does not automatically
|
|
158
159
|
compile a local addon.
|
|
159
160
|
|
|
@@ -240,13 +241,20 @@ moss-tts-delay-f16.gguf (~17 GB)
|
|
|
240
241
|
moss-ttsd-f16.gguf (~17 GB; MOSS-TTSD dialogue backbone, optional)
|
|
241
242
|
moss-codec-decoder-f16.gguf (~1.8 GB)
|
|
242
243
|
moss-codec-encoder-f16.gguf (~1.8 GB; cloning and dialogue only)
|
|
244
|
+
moss-codec-decoder.mlmodelc/ (optional, macOS / iOS: Apple Core ML sidecar for
|
|
245
|
+
the codec decoder while streaming; see Core ML
|
|
246
|
+
sidecars on Apple)
|
|
243
247
|
|
|
244
248
|
# MOSS-SoundEffect (OpenMOSS MOSS-SoundEffect-v2; 48 kHz text-to-sound-effects)
|
|
245
249
|
moss-sfx-v2-q8_0.gguf (~3.5 GB; or moss-sfx-v2-f16.gguf, ~6.4 GB)
|
|
250
|
+
moss-sfx-v2-dit.mlmodelc/ (optional, macOS / iOS: Apple Core ML sidecars for
|
|
251
|
+
moss-sfx-v2-vae.mlmodelc/ the diffusion transformer and the VAE decoder)
|
|
246
252
|
|
|
247
253
|
# MOSS-Speech (fnlp/MOSS-Speech; 24 kHz speech-to-speech)
|
|
248
254
|
moss-speech-q8_0.gguf (~9.7 GB; or moss-speech-bf16.gguf, ~18.2 GB)
|
|
249
255
|
moss-speech-codec-f16.gguf (~1.3 GB; carries the default reply voice)
|
|
256
|
+
moss-speech-codec-tokenizer.mlmodelc/ (optional, macOS / iOS: Apple Core ML
|
|
257
|
+
sidecar for the speech tokenizer)
|
|
250
258
|
```
|
|
251
259
|
|
|
252
260
|
Download the registry-published Chatterbox, Supertonic, and Parler models into
|
|
@@ -695,7 +703,8 @@ keeps the automatic preference above.
|
|
|
695
703
|
### Core ML sidecars on Apple
|
|
696
704
|
|
|
697
705
|
The macOS / iOS prebuilds carry the Apple Core ML (Neural Engine) sidecars
|
|
698
|
-
for the Supertonic vocoder
|
|
706
|
+
for the Supertonic vocoder, the Audio8 codec, and the MOSS models' fixed-shape
|
|
707
|
+
stages. They are presence-driven:
|
|
699
708
|
each stage runs on a compiled `.mlmodelc` found next to its model file
|
|
700
709
|
(`supertonic3-q8_0.gguf` -> `supertonic3-vocoder.mlmodelc`) and falls back to
|
|
701
710
|
the ggml graph when it is absent, so a model directory without sidecars
|
|
@@ -707,13 +716,19 @@ published model set yet; supply your own to opt in.
|
|
|
707
716
|
| --- | --- | --- | --- | --- |
|
|
708
717
|
| Supertonic 1 / 2 / 3 | `<model>-vocoder.mlmodelc` | vocoder, in 64-latent-frame windows | GGUFs whose vocoder weights are stored below 8 bits (`q4_0`) | `SUPERTONIC_COREML_DISABLE=1` |
|
|
709
718
|
| Audio8 | `audio8-codec-decoder.mlmodelc`, beside the codec decoder GGUF | codec synthesis stack (upsampling + DAC decoder), in 64-post-frame windows synthesised while the language model is still generating, so only the last one is left after it; the language model stays on the ggml backend | a call that fails on the sidecar, which also retires it for every later call on that instance | `AUDIO8_COREML_DISABLE=1` |
|
|
710
|
-
|
|
|
719
|
+
| MOSS, MOSS-TTSD | `moss-codec-decoder.mlmodelc`, beside the codec decoder GGUF | codec decoder, 25 frames (2 s) per call, keeping its attention cache between calls (macOS 15 / iOS 18) | non-streaming synthesis and streams with `streamChunkTokens` above 25, which ggml decodes faster in one pass | `MOSS_COREML_DISABLE=1` |
|
|
720
|
+
| MOSS-SoundEffect | `moss-sfx-v2-dit.mlmodelc` and `moss-sfx-v2-vae.mlmodelc` | diffusion transformer, one velocity per call; VAE decoder in 320-frame windows | a call that fails on the sidecar, which retires it | `MOSS_COREML_DISABLE=1` |
|
|
721
|
+
| MOSS-Speech | `moss-speech-codec-tokenizer.mlmodelc`, beside the codec GGUF | speech tokenizer (Whisper-VQ encoder), one full 30 s segment per call | segments shorter than 30 s, which ggml encodes faster; so most spoken questions | `MOSS_COREML_DISABLE=1` |
|
|
722
|
+
| Chatterbox, Parler, CosyVoice3, LavaSR | none | — | always | — |
|
|
711
723
|
|
|
712
724
|
Set the force-ggml variables in the process environment before `load()`.
|
|
713
725
|
Audio8 reports its codec path in `response.stats`: `codecSidecarLoaded` is 1
|
|
714
726
|
while the sidecar is attached and `codecOnCoreml` is 1 when that synthesis
|
|
715
727
|
ran its codec on it (see [Response shape](#response-shape)). The Supertonic
|
|
716
|
-
vocoder path is not reported in the stats.
|
|
728
|
+
vocoder path is not reported in the stats, and neither are the MOSS paths.
|
|
729
|
+
The MOSS sidecars run on the GPU unless `MOSS_COREML_COMPUTE_UNITS` (`all`,
|
|
730
|
+
`cpu_and_ane`, `cpu_only`) says otherwise: none of their stages ran faster on
|
|
731
|
+
the Neural Engine, and the speech tokenizer loses code accuracy there.
|
|
717
732
|
|
|
718
733
|
Worth it where the GPU is consumer-class: on an Apple M4 the Supertonic
|
|
719
734
|
vocoder runs 1.6-2.9x faster on the Neural Engine than on Metal (1.06-1.13x
|
|
@@ -722,14 +737,25 @@ so do not stage a sidecar there. `q4_0` models ignore the vocoder sidecar:
|
|
|
722
737
|
it carries full-precision weights and would substitute a different vocoder
|
|
723
738
|
rather than accelerate the quantized one.
|
|
724
739
|
|
|
740
|
+
The MOSS sidecars, per stage against Metal with f16 models:
|
|
741
|
+
|
|
742
|
+
| Stage | Apple M4 | Apple M3 Ultra |
|
|
743
|
+
| --- | --- | --- |
|
|
744
|
+
| MOSS-SoundEffect diffusion transformer | 1.23x | 1.06x |
|
|
745
|
+
| MOSS-SoundEffect VAE decoder | 1.70x | 1.81x |
|
|
746
|
+
| MOSS-Speech tokenizer, full 30 s segment | 1.24x | 1.08x |
|
|
747
|
+
| MOSS codec, streamed in 25-frame chunks | 1.03x | 1.13x |
|
|
748
|
+
|
|
725
749
|
Export the sidecars from the model GGUFs with
|
|
726
|
-
`engines/tts/scripts/export-supertonic-coreml.py
|
|
727
|
-
`engines/tts/scripts/export-audio8-codec-coreml.py
|
|
750
|
+
`engines/tts/scripts/export-supertonic-coreml.py`,
|
|
751
|
+
`engines/tts/scripts/export-audio8-codec-coreml.py`, and
|
|
752
|
+
`engines/tts/scripts/export-moss-{codec,sfx,speech-tokenizer}-coreml.py` from the
|
|
728
753
|
[`qvac-fabric-speech.cpp`](https://github.com/tetherto/qvac-fabric-speech.cpp)
|
|
729
754
|
tree at the ref `speech-cpp` pins. Its
|
|
730
|
-
[Supertonic](https://github.com/tetherto/qvac-fabric-speech.cpp/blob/master/engines/tts/docs/supertonic.md#core-ml-vocoder-sidecar)
|
|
755
|
+
[Supertonic](https://github.com/tetherto/qvac-fabric-speech.cpp/blob/master/engines/tts/docs/supertonic.md#core-ml-vocoder-sidecar),
|
|
756
|
+
[Audio8](https://github.com/tetherto/qvac-fabric-speech.cpp/blob/master/engines/tts/docs/audio8.md#core-ml-codec-sidecar),
|
|
731
757
|
and
|
|
732
|
-
[
|
|
758
|
+
[MOSS](https://github.com/tetherto/qvac-fabric-speech.cpp/blob/master/engines/tts/docs/moss.md#core-ml-codec-decoder)
|
|
733
759
|
guides cover export, placement, and measurements.
|
|
734
760
|
|
|
735
761
|
When the addon is built with `ENABLE_CUDA` — on in the published linux-x64
|
|
@@ -779,13 +805,13 @@ registration and the addon falls back to Vulkan or CPU.
|
|
|
779
805
|
|
|
780
806
|
Android prebuilds enable `GGML_BACKEND_DL=ON` and ship per-arch
|
|
781
807
|
backend `.so` files under
|
|
782
|
-
`prebuilds
|
|
808
|
+
`prebuilds/android-arm64/qvac__tts-ggml-android-arm64/` of
|
|
809
|
+
`@qvac/tts-ggml-android-arm64`; `bare-link` puts them next to the module in
|
|
810
|
+
the app, where the addon looks when `backendsDir` is unset.
|
|
783
811
|
|
|
784
812
|
The engine `dlopen()`s the highest-tier CPU variant the device's
|
|
785
813
|
HWCAPs support and one of the GPU `.so` files based on the policy
|
|
786
|
-
table above.
|
|
787
|
-
'prebuilds')` (or rely on the default fallback the package ships)
|
|
788
|
-
so the runtime knows where to look. `openclCacheDir` is also
|
|
814
|
+
table above. `openclCacheDir` is
|
|
789
815
|
Android-specific; setting it to a writable path lets the OpenCL
|
|
790
816
|
backend persist its compiled program cache across launches.
|
|
791
817
|
`vulkanCacheDir` is the Vulkan analogue (Supertonic + `useGPU: true`):
|
|
@@ -1202,7 +1228,7 @@ instance. Runtime stats add `promptTokens`, `generatedTokens`, `replyTokens`,
|
|
|
1202
1228
|
| `promptText` | string | — | CosyVoice3-only: verbatim transcript of `referenceAudio` — set for zero-shot cloning, omit for cross-lingual; without a reference it overrides the baked voice's transcript |
|
|
1203
1229
|
| `mecabDictDir` | string | — | Chatterbox MTL Japanese (`ja`): compiled MeCab/IPAdic dictionary directory |
|
|
1204
1230
|
| `cangjieTsvPath` | string | — | Chatterbox MTL Chinese (`zh`): `Cangjie5_TC` TSV path |
|
|
1205
|
-
| `backendsDir` | string |
|
|
1231
|
+
| `backendsDir` | string | the module's own | Directory the addon scans, as given, for dynamically-loaded ggml backend `.so` / `.dll` files. Unset scans the directory the native module was loaded from (`prebuilds/<host>/qvac__tts-ggml-<suffix>/` in a platform package, the app's native library directory after `bare-link`); ignored on platforms that statically link the backend |
|
|
1206
1232
|
| `openclCacheDir` | string | unset | Android-only: directory where the OpenCL backend persists its compiled program-binary cache. Setting it across runs avoids re-JITing the kernels on every fresh process |
|
|
1207
1233
|
| `vulkanCacheDir` | string | unset | Supertonic + `useGPU: true` only: writable directory where the Vulkan backend persists its compiled pipeline cache (`GGML_VK_PIPELINE_CACHE_DIR`). Moves the one-time first-dispatch pipeline-compile cost (seconds on Mali) off the first `run()` — paid once per install instead of once per process — and enables a load-time pre-warm. Fully opt-in: unset -> no cross-process cache, no pre-warm, behaviour unchanged |
|
|
1208
1234
|
| `config.language` | string | `"en"` | Chatterbox MTL accepts `es/fr/de/pt/it/zh/ja/ko/...`; turbo & Supertonic are English; MOSS takes it as a prompt hint (`en`, `zh`, ...) |
|
|
@@ -1545,14 +1571,28 @@ npm install
|
|
|
1545
1571
|
npx bare-make generate # configures + fetches the tts-cpp port
|
|
1546
1572
|
npx bare-make build
|
|
1547
1573
|
npx bare-make install # copies the .bare into prebuilds/<triple>/
|
|
1574
|
+
npm run link:platform # stages node_modules/@qvac/tts-ggml-<host>
|
|
1548
1575
|
```
|
|
1549
1576
|
|
|
1577
|
+
`require('#host-addon')` only ever loads a platform package, so a source
|
|
1578
|
+
build becomes loadable once `npm run link:platform` (run by
|
|
1579
|
+
`npm run build:native`) wraps `prebuilds/<host>/` as that host's
|
|
1580
|
+
`@qvac/tts-ggml-<host>` package in `node_modules/`.
|
|
1581
|
+
|
|
1550
1582
|
The vcpkg port is hosted in
|
|
1551
1583
|
[`tetherto/qvac-registry-vcpkg`][registry] and pulls
|
|
1552
1584
|
[`qvac-tts.cpp`][qvac-tts-cpp] at a pinned REF. See
|
|
1553
1585
|
[`vcpkg-configuration.json`](./vcpkg-configuration.json) for the
|
|
1554
1586
|
baseline commit.
|
|
1555
1587
|
|
|
1588
|
+
`ggml-speech` and `speech-cpp` are pinned with vcpkg `overrides` to the
|
|
1589
|
+
same versions in every speech addon (`@qvac/asr-ggml`,
|
|
1590
|
+
`@qvac/audiogen-ggml`, `@qvac/bci-whispercpp`, `@qvac/tts-ggml`), and
|
|
1591
|
+
`package.json` records the `ggml-speech` build as `qvac["ggml-speech"]`.
|
|
1592
|
+
The speech addons ship their ggml backends under the same file names, so
|
|
1593
|
+
an app that bundles several of them keeps one copy of each: use releases
|
|
1594
|
+
that record the same `ggml-speech`.
|
|
1595
|
+
|
|
1556
1596
|
GPU backends are controlled by the `speech-cpp` port's vcpkg features:
|
|
1557
1597
|
`metal` (default on osx/ios), `vulkan` (default on
|
|
1558
1598
|
linux/windows/android), `opencl` (default on android), and `cuda`
|
package/addon-unavailable.js
CHANGED
|
@@ -1,31 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
// "#host-addon" target for hosts with no platform package. Hosts that have one
|
|
4
|
+
// map straight to it with no fallback, so a missing install fails bare-pack (and
|
|
5
|
+
// fails at run time naming the package) instead of producing a bundle that only
|
|
6
|
+
// throws once launched.
|
|
7
|
+
const host = require.addon ? require.addon.host : 'unknown'
|
|
5
8
|
|
|
6
|
-
throw new Error(
|
|
7
|
-
|
|
8
|
-
function currentHost() {
|
|
9
|
-
return require.addon ? require.addon.host : null
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function buildMessage(host) {
|
|
13
|
-
if (!host || !PREBUILT_HOSTS.includes(host)) {
|
|
14
|
-
return (
|
|
15
|
-
META_PACKAGE +
|
|
16
|
-
' has no prebuilt binaries for host ' +
|
|
17
|
-
(host || UNKNOWN_HOST) +
|
|
18
|
-
'. Prebuilt hosts: ' +
|
|
19
|
-
PREBUILT_HOSTS.join(', ') +
|
|
20
|
-
'. Build from source with bare-make.'
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
|
-
return (
|
|
24
|
-
META_PACKAGE +
|
|
25
|
-
' found no native prebuild for ' +
|
|
9
|
+
throw new Error(
|
|
10
|
+
'@qvac/tts-ggml has no prebuilt binaries for host ' +
|
|
26
11
|
host +
|
|
27
|
-
'
|
|
28
|
-
|
|
29
|
-
'
|
|
30
|
-
|
|
31
|
-
}
|
|
12
|
+
'. Platform packages exist for linux-x64, linux-arm64, darwin-arm64, ' +
|
|
13
|
+
'darwin-x64, win32-x64, android-arm64 and ios (ios-arm64, ' +
|
|
14
|
+
'ios-arm64-simulator, ios-x64-simulator). Build from source with bare-make.'
|
|
15
|
+
)
|
package/binding.js
CHANGED
|
@@ -1,52 +1 @@
|
|
|
1
|
-
module.exports =
|
|
2
|
-
|
|
3
|
-
// `require.addon()` reads the prebuild shipped inside this package. Since the
|
|
4
|
-
// per-platform split (0.9.0) there is none, so the real binding almost always
|
|
5
|
-
// comes from the `#host-addon` platform package. Runtimes have been seen to
|
|
6
|
-
// answer `require.addon()` with this package's own JavaScript entry instead of
|
|
7
|
-
// failing, which used to be returned verbatim: callers then got a module with
|
|
8
|
-
// no `createInstance`, and the first symptom was an unrelated TypeError deep in
|
|
9
|
-
// a model load. Anything that is not the native binding is treated as a miss.
|
|
10
|
-
function loadAddon() {
|
|
11
|
-
let cause = null
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
const addon = require.addon()
|
|
15
|
-
if (isNativeBinding(addon)) return addon
|
|
16
|
-
cause = new Error(
|
|
17
|
-
'@qvac/tts-ggml: require.addon() answered with a module that is not the native binding ' +
|
|
18
|
-
'(no createInstance function), so the prebuild in this package was treated as absent.'
|
|
19
|
-
)
|
|
20
|
-
} catch (err) {
|
|
21
|
-
cause = err
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return loadPlatformPackageAddon(cause)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function loadPlatformPackageAddon(cause) {
|
|
28
|
-
let addon
|
|
29
|
-
|
|
30
|
-
try {
|
|
31
|
-
addon = require('#host-addon')
|
|
32
|
-
} catch (err) {
|
|
33
|
-
if (err.cause === undefined) err.cause = cause
|
|
34
|
-
throw err
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (!isNativeBinding(addon)) {
|
|
38
|
-
const err = new Error(
|
|
39
|
-
'@qvac/tts-ggml resolved #host-addon to a module that is not the native binding: ' +
|
|
40
|
-
'it has no createInstance function. Check that the platform package for this host ' +
|
|
41
|
-
'is installed and is not shadowed by another module of the same name.'
|
|
42
|
-
)
|
|
43
|
-
err.cause = cause
|
|
44
|
-
throw err
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return addon
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function isNativeBinding(addon) {
|
|
51
|
-
return addon !== null && typeof addon === 'object' && typeof addon.createInstance === 'function'
|
|
52
|
-
}
|
|
1
|
+
module.exports = require('#host-addon')
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type QvacResponse } from "@qvac/infer-base";
|
|
2
2
|
import * as errorModule from "./lib/error";
|
|
3
|
-
import { resolveBackendsDir as resolveBackendsDirImpl } from "./lib/backends";
|
|
4
3
|
import { assessFit as assessFitImpl, type Audio8FitRequest, type MossFitRequest, type MossSoundEffectFitRequest, type ChatterboxFitRequest, type CosyvoiceFitRequest, type ParlerFitRequest, type SupertonicFitRequest, type TtsFitEngine, type TtsFitRequest, type TtsFitResult, type TtsFitStatus } from "./lib/fit";
|
|
5
4
|
import { type SentenceDelimiterPreset } from "./lib/textStreamAccumulator";
|
|
6
5
|
declare const ENGINE_CHATTERBOX = "chatterbox";
|
|
@@ -607,7 +606,11 @@ interface TTSGgmlOptions extends ParlerDescriptionFields, Audio8VoiceFields, TTS
|
|
|
607
606
|
* streaming (batch synthesis only).
|
|
608
607
|
*/
|
|
609
608
|
denoiser?: LavaSRDenoiserOptions;
|
|
610
|
-
/**
|
|
609
|
+
/**
|
|
610
|
+
* Directory the addon scans for dynamically loaded ggml backends, as given.
|
|
611
|
+
* Unset scans the addon's own: the one its platform package or the app
|
|
612
|
+
* installed next to the native module.
|
|
613
|
+
*/
|
|
611
614
|
backendsDir?: string;
|
|
612
615
|
/** Directory where ggml-opencl persists its compiled program binary. */
|
|
613
616
|
openclCacheDir?: string;
|
|
@@ -1211,7 +1214,6 @@ declare namespace TTSGgml {
|
|
|
1211
1214
|
type MossFitRequest = NamespaceMossFit;
|
|
1212
1215
|
type MossSoundEffectFitRequest = NamespaceMossSoundEffectFit;
|
|
1213
1216
|
type CosyvoiceFitRequest = NamespaceCosyvoiceFit;
|
|
1214
|
-
const resolveBackendsDir: typeof resolveBackendsDirImpl;
|
|
1215
1217
|
const assessFit: typeof assessFitImpl;
|
|
1216
1218
|
}
|
|
1217
1219
|
export = TTSGgml;
|
package/index.js
CHANGED
|
@@ -46,7 +46,6 @@ const infer_base_1 = require("@qvac/infer-base");
|
|
|
46
46
|
const tts_1 = require("./tts");
|
|
47
47
|
const errorModule = __importStar(require("./lib/error"));
|
|
48
48
|
const pocketConfig_1 = require("./lib/pocketConfig");
|
|
49
|
-
const backends_1 = require("./lib/backends");
|
|
50
49
|
const fit_1 = require("./lib/fit");
|
|
51
50
|
const textChunker_1 = require("./lib/textChunker");
|
|
52
51
|
const textStreamAccumulator_1 = require("./lib/textStreamAccumulator");
|
|
@@ -1293,7 +1292,7 @@ class TTSGgml {
|
|
|
1293
1292
|
this._assignSynthesisOptions(options);
|
|
1294
1293
|
this._enhancerGgufPath = resolveEnhancerGgufPath(normalizedFiles, options.enhancer);
|
|
1295
1294
|
this._denoiserGgufPath = resolveDenoiserGgufPath(normalizedFiles, options.denoiser);
|
|
1296
|
-
this._backendsDir = firstNonEmpty(options.backendsDir, this._config.backendsDir
|
|
1295
|
+
this._backendsDir = firstNonEmpty(options.backendsDir, this._config.backendsDir);
|
|
1297
1296
|
this._openclCacheDir = firstNonEmpty(options.openclCacheDir, this._config.openclCacheDir);
|
|
1298
1297
|
this._vulkanCacheDir = firstNonEmpty(options.vulkanCacheDir, this._config.vulkanCacheDir);
|
|
1299
1298
|
assertGpuIntentConsistent(this._config.useGPU, this._nGpuLayers);
|
|
@@ -3311,7 +3310,6 @@ class TTSGgml {
|
|
|
3311
3310
|
(function (TTSGgml) {
|
|
3312
3311
|
TTSGgml.QvacErrorAddonTTSGgml = errorModule.QvacErrorAddonTTSGgml;
|
|
3313
3312
|
TTSGgml.ERR_CODES = errorModule.ERR_CODES;
|
|
3314
|
-
TTSGgml.resolveBackendsDir = backends_1.resolveBackendsDir;
|
|
3315
3313
|
TTSGgml.assessFit = fit_1.assessFit;
|
|
3316
3314
|
})(TTSGgml || (TTSGgml = {}));
|
|
3317
3315
|
module.exports.QvacErrorAddonTTSGgml =
|
package/lib/fit.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.assessFit = assessFit;
|
|
4
|
-
const backends_1 = require("./backends");
|
|
5
4
|
/**
|
|
6
5
|
* Projects one voice against the memory free right now, reading GGUF metadata
|
|
7
6
|
* and never weight data. The registry's weightless copy of each file answers
|
|
@@ -18,12 +17,7 @@ const backends_1 = require("./backends");
|
|
|
18
17
|
* throws.
|
|
19
18
|
*/
|
|
20
19
|
function assessFit(request) {
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports -- native binding
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports -- the native binding loads on first use.
|
|
22
21
|
const binding = require('../binding.js');
|
|
23
|
-
return binding.assessFit(
|
|
24
|
-
...request,
|
|
25
|
-
backendsDir: typeof request.backendsDir === 'string' && request.backendsDir.length > 0
|
|
26
|
-
? request.backendsDir
|
|
27
|
-
: (0, backends_1.resolveBackendsDir)()
|
|
28
|
-
});
|
|
22
|
+
return binding.assessFit(request);
|
|
29
23
|
}
|
package/package.json
CHANGED
|
@@ -1,60 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qvac/tts-ggml",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Text to Speech (TTS) addon for qvac (ggml backend, wrapping the chatterbox + supertonic + parler + cosyvoice3 + audio8 + moss + moss-sfx + moss-speech + Pocket engines from tts-cpp)",
|
|
5
|
-
"
|
|
5
|
+
"qvac": {
|
|
6
|
+
"ggml-speech": "2026-10-07#1"
|
|
7
|
+
},
|
|
6
8
|
"engines": {
|
|
7
9
|
"bare": ">=1.19.0"
|
|
8
10
|
},
|
|
9
11
|
"imports": {
|
|
10
12
|
"#host-addon": {
|
|
11
13
|
"linux": {
|
|
12
|
-
"x64":
|
|
13
|
-
|
|
14
|
-
"./addon-unavailable.js"
|
|
15
|
-
],
|
|
16
|
-
"arm64": [
|
|
17
|
-
"@qvac/tts-ggml-linux-arm64",
|
|
18
|
-
"./addon-unavailable.js"
|
|
19
|
-
],
|
|
14
|
+
"x64": "@qvac/tts-ggml-linux-x64",
|
|
15
|
+
"arm64": "@qvac/tts-ggml-linux-arm64",
|
|
20
16
|
"default": "./addon-unavailable.js"
|
|
21
17
|
},
|
|
22
18
|
"darwin": {
|
|
23
|
-
"arm64":
|
|
24
|
-
|
|
25
|
-
"./addon-unavailable.js"
|
|
26
|
-
],
|
|
27
|
-
"x64": [
|
|
28
|
-
"@qvac/tts-ggml-darwin-x64",
|
|
29
|
-
"./addon-unavailable.js"
|
|
30
|
-
],
|
|
19
|
+
"arm64": "@qvac/tts-ggml-darwin-arm64",
|
|
20
|
+
"x64": "@qvac/tts-ggml-darwin-x64",
|
|
31
21
|
"default": "./addon-unavailable.js"
|
|
32
22
|
},
|
|
33
23
|
"win32": {
|
|
34
|
-
"x64":
|
|
35
|
-
"@qvac/tts-ggml-win32-x64",
|
|
36
|
-
"./addon-unavailable.js"
|
|
37
|
-
],
|
|
24
|
+
"x64": "@qvac/tts-ggml-win32-x64",
|
|
38
25
|
"default": "./addon-unavailable.js"
|
|
39
26
|
},
|
|
40
27
|
"android": {
|
|
41
|
-
"arm64":
|
|
42
|
-
"@qvac/tts-ggml-android-arm64",
|
|
43
|
-
"./addon-unavailable.js"
|
|
44
|
-
],
|
|
28
|
+
"arm64": "@qvac/tts-ggml-android-arm64",
|
|
45
29
|
"default": "./addon-unavailable.js"
|
|
46
30
|
},
|
|
47
|
-
"ios":
|
|
48
|
-
"@qvac/tts-ggml-ios",
|
|
49
|
-
"./addon-unavailable.js"
|
|
50
|
-
],
|
|
31
|
+
"ios": "@qvac/tts-ggml-ios",
|
|
51
32
|
"default": "./addon-unavailable.js"
|
|
52
33
|
}
|
|
53
34
|
},
|
|
54
35
|
"scripts": {
|
|
55
36
|
"build": "npm run build:ts && npm run build:native",
|
|
56
|
-
"build:native": "bare-make generate -D BUILD_FUZZING=OFF && bare-make build && bare-make install",
|
|
57
|
-
"build:native:cuda": "bare-make generate -D ENABLE_CUDA=ON -D BUILD_FUZZING=OFF && bare-make build && bare-make install",
|
|
37
|
+
"build:native": "bare-make generate -D BUILD_FUZZING=OFF && bare-make build && bare-make install && npm run link:platform",
|
|
38
|
+
"build:native:cuda": "bare-make generate -D ENABLE_CUDA=ON -D BUILD_FUZZING=OFF && bare-make build && bare-make install && npm run link:platform",
|
|
39
|
+
"link:platform": "node ../../scripts/ci/slice-platform-packages.mjs --link-local --workdir .",
|
|
58
40
|
"build:cuda": "npm run build:ts && npm run build:native:cuda",
|
|
59
41
|
"build:ts": "tsc -p tsconfig.build.json",
|
|
60
42
|
"build:pack": "npm run build:ts && mkdir -p dist && npm pack --pack-destination dist",
|
|
@@ -83,10 +65,10 @@
|
|
|
83
65
|
"example:moss-sfx": "bare examples/moss-sound-effect.js \"Heavy rain falling on a tin roof with distant thunder.\" 5",
|
|
84
66
|
"example:moss-speech": "bare examples/moss-speech.js test/reference-audio/jfk.wav",
|
|
85
67
|
"lint": "npm run lint:js && npm run lint:ts && npm run test:types",
|
|
86
|
-
"lint:js": "prettier --check \"test/**/*.js\" \"scripts/run-cpp-fuzz.js\" \"scripts/__tests__/package-contract.test.js\" \"scripts/__tests__/
|
|
68
|
+
"lint:js": "prettier --check \"test/**/*.js\" \"scripts/run-cpp-fuzz.js\" \"scripts/__tests__/package-contract.test.js\" \"scripts/__tests__/run-cpp-fuzz.test.js\" \"binding.js\" \"addon-unavailable.js\" && lunte \"test/**/*.js\" \"scripts/run-cpp-fuzz.js\" \"scripts/__tests__/package-contract.test.js\" \"scripts/__tests__/run-cpp-fuzz.test.js\" \"binding.js\" \"addon-unavailable.js\"",
|
|
87
69
|
"lint:ts": "eslint \"src/**/*.ts\" --max-warnings=0",
|
|
88
70
|
"lint:ts:fix": "eslint \"src/**/*.ts\" --fix",
|
|
89
|
-
"format": "prettier --write \"test/**/*.js\" \"scripts/__tests__/package-contract.test.js\" \"
|
|
71
|
+
"format": "prettier --write \"test/**/*.js\" \"scripts/__tests__/package-contract.test.js\" \"binding.js\" \"addon-unavailable.js\"",
|
|
90
72
|
"test:unit": "npm run build:ts && brittle-bare test/unit/**/*.test.js && npm run test:node",
|
|
91
73
|
"test:node": "node --test scripts/__tests__/*.test.js",
|
|
92
74
|
"test": "npm run test:types && npm run test:unit && npm run test:integration",
|
|
@@ -195,7 +177,7 @@
|
|
|
195
177
|
"bugs": "https://github.com/tetherto/qvac/issues",
|
|
196
178
|
"homepage": "https://qvac.tether.io",
|
|
197
179
|
"devDependencies": {
|
|
198
|
-
"@qvac/asr-ggml": "
|
|
180
|
+
"@qvac/asr-ggml": "0.8.1",
|
|
199
181
|
"@qvac/registry-client": "^0.6.1",
|
|
200
182
|
"cmake-bare": "^1.7.5",
|
|
201
183
|
"cmake-vcpkg": "^1.1.0",
|
|
@@ -229,12 +211,24 @@
|
|
|
229
211
|
"bare-stream": "^2.7.0",
|
|
230
212
|
"bare-url": "^2.4.3"
|
|
231
213
|
},
|
|
232
|
-
"types": "index.d.ts",
|
|
233
214
|
"optionalDependencies": {
|
|
234
|
-
"@qvac/tts-ggml-linux-x64": "0.
|
|
235
|
-
"@qvac/tts-ggml-linux-arm64": "0.
|
|
236
|
-
"@qvac/tts-ggml-darwin-arm64": "0.
|
|
237
|
-
"@qvac/tts-ggml-darwin-x64": "0.
|
|
238
|
-
"@qvac/tts-ggml-win32-x64": "0.
|
|
215
|
+
"@qvac/tts-ggml-linux-x64": "0.12.0",
|
|
216
|
+
"@qvac/tts-ggml-linux-arm64": "0.12.0",
|
|
217
|
+
"@qvac/tts-ggml-darwin-arm64": "0.12.0",
|
|
218
|
+
"@qvac/tts-ggml-darwin-x64": "0.12.0",
|
|
219
|
+
"@qvac/tts-ggml-win32-x64": "0.12.0"
|
|
220
|
+
},
|
|
221
|
+
"types": "index.d.ts",
|
|
222
|
+
"peerDependencies": {
|
|
223
|
+
"@qvac/tts-ggml-android-arm64": "0.12.0",
|
|
224
|
+
"@qvac/tts-ggml-ios": "0.12.0"
|
|
225
|
+
},
|
|
226
|
+
"peerDependenciesMeta": {
|
|
227
|
+
"@qvac/tts-ggml-android-arm64": {
|
|
228
|
+
"optional": true
|
|
229
|
+
},
|
|
230
|
+
"@qvac/tts-ggml-ios": {
|
|
231
|
+
"optional": true
|
|
232
|
+
}
|
|
239
233
|
}
|
|
240
234
|
}
|
package/lib/backends.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const PREBUILT_HOSTS: string[];
|
|
2
|
-
export interface BackendsDirSources {
|
|
3
|
-
localPrebuildsDir: string;
|
|
4
|
-
host: string | null;
|
|
5
|
-
directoryExists: (dir: string) => boolean;
|
|
6
|
-
resolveManifest: (specifier: string) => string | null;
|
|
7
|
-
}
|
|
8
|
-
export declare function hostPlatformPackage(host: string): string;
|
|
9
|
-
export declare function resolveBackendsDirFrom(sources: BackendsDirSources): string;
|
|
10
|
-
export declare function resolveBackendsDir(): string;
|
package/lib/backends.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PREBUILT_HOSTS = void 0;
|
|
4
|
-
exports.hostPlatformPackage = hostPlatformPackage;
|
|
5
|
-
exports.resolveBackendsDirFrom = resolveBackendsDirFrom;
|
|
6
|
-
exports.resolveBackendsDir = resolveBackendsDir;
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-require-imports -- Bare modules expose CommonJS export shapes. */
|
|
8
|
-
const fs = require("bare-fs");
|
|
9
|
-
const path = require("bare-path");
|
|
10
|
-
/* eslint-enable @typescript-eslint/no-require-imports */
|
|
11
|
-
const PACKAGE_ROOT = path.join(__dirname, "..");
|
|
12
|
-
const PREBUILDS_DIR_NAME = "prebuilds";
|
|
13
|
-
const PLATFORM_ADDON_DIR_NAME = "addon";
|
|
14
|
-
const PLATFORM_PACKAGE_PREFIX = "@qvac/tts-ggml-";
|
|
15
|
-
const PLATFORM_MANIFEST_SUBPATH = "/package";
|
|
16
|
-
const IOS_PLATFORM = "ios";
|
|
17
|
-
const HOST_SEPARATOR = "-";
|
|
18
|
-
exports.PREBUILT_HOSTS = [
|
|
19
|
-
"linux-x64",
|
|
20
|
-
"linux-arm64",
|
|
21
|
-
"darwin-arm64",
|
|
22
|
-
"darwin-x64",
|
|
23
|
-
"win32-x64",
|
|
24
|
-
"android-arm64",
|
|
25
|
-
"ios-arm64",
|
|
26
|
-
"ios-arm64-simulator",
|
|
27
|
-
"ios-x64-simulator",
|
|
28
|
-
];
|
|
29
|
-
function hostPlatformPackage(host) {
|
|
30
|
-
const platform = host.split(HOST_SEPARATOR)[0];
|
|
31
|
-
const suffix = platform === IOS_PLATFORM ? IOS_PLATFORM : host;
|
|
32
|
-
return PLATFORM_PACKAGE_PREFIX + suffix;
|
|
33
|
-
}
|
|
34
|
-
function resolveBackendsDirFrom(sources) {
|
|
35
|
-
if (sources.directoryExists(sources.localPrebuildsDir)) {
|
|
36
|
-
return sources.localPrebuildsDir;
|
|
37
|
-
}
|
|
38
|
-
return platformPackagePrebuildsDir(sources) ?? sources.localPrebuildsDir;
|
|
39
|
-
}
|
|
40
|
-
function platformPackagePrebuildsDir(sources) {
|
|
41
|
-
if (!sources.host) {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
const manifestPath = sources.resolveManifest(hostPlatformPackage(sources.host) + PLATFORM_MANIFEST_SUBPATH);
|
|
45
|
-
if (!manifestPath) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
return path.join(path.dirname(manifestPath), PLATFORM_ADDON_DIR_NAME, PREBUILDS_DIR_NAME);
|
|
49
|
-
}
|
|
50
|
-
function resolveBackendsDir() {
|
|
51
|
-
return resolveBackendsDirFrom({
|
|
52
|
-
localPrebuildsDir: path.join(PACKAGE_ROOT, PREBUILDS_DIR_NAME),
|
|
53
|
-
host: currentHost(),
|
|
54
|
-
directoryExists: safeDirectoryExists,
|
|
55
|
-
resolveManifest: safeResolveManifest,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
function currentHost() {
|
|
59
|
-
return require.addon ? require.addon.host : null;
|
|
60
|
-
}
|
|
61
|
-
function safeDirectoryExists(dir) {
|
|
62
|
-
try {
|
|
63
|
-
return fs.existsSync(dir);
|
|
64
|
-
}
|
|
65
|
-
catch {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
function safeResolveManifest(specifier) {
|
|
70
|
-
try {
|
|
71
|
-
return require.resolve(specifier);
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
}
|