@tryhamster/gerbil 1.11.0 → 1.11.1
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/dist/cli.mjs +1 -1
- package/dist/cli.mjs.map +1 -1
- package/dist/{defaults-C_bJK9zs.mjs → defaults-DfGx4d1m.mjs} +22 -2
- package/dist/{defaults-C_bJK9zs.mjs.map → defaults-DfGx4d1m.mjs.map} +1 -1
- package/dist/frameworks/next.d.mts +2 -2
- package/dist/{gerbil-6E0XH_8s.d.mts → gerbil-CaAGG2VP.d.mts} +2 -2
- package/dist/{gerbil-6E0XH_8s.d.mts.map → gerbil-CaAGG2VP.d.mts.map} +1 -1
- package/dist/gpu/hooks.d.mts +1 -1
- package/dist/gpu/hooks.mjs +1 -1
- package/dist/gpu/index.d.mts +2 -2
- package/dist/gpu/index.mjs +3 -3
- package/dist/{gpu-CzgbyVeq.mjs → gpu-BCfd_K38.mjs} +57 -17
- package/dist/{gpu-CzgbyVeq.mjs.map → gpu-BCfd_K38.mjs.map} +1 -1
- package/dist/index-B3tjyDJI.d.mts.map +1 -1
- package/dist/{index-DyqcKFfQ.d.mts → index-DqJMofyU.d.mts} +37 -7
- package/dist/index-DqJMofyU.d.mts.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/integrations/mcp.d.mts +2 -2
- package/dist/skills/index.d.mts +4 -4
- package/dist/tune/index.d.mts.map +1 -1
- package/package.json +1 -1
- package/dist/index-DyqcKFfQ.d.mts.map +0 -1
|
@@ -47,6 +47,26 @@ const OUTETTS_PRESET_VOICES = [
|
|
|
47
47
|
"gerbil-voice-5",
|
|
48
48
|
"gerbil-voice-6"
|
|
49
49
|
];
|
|
50
|
+
/**
|
|
51
|
+
* True when `repo`/`architecture` identify a text-to-speech checkpoint that must
|
|
52
|
+
* run through a dedicated native TTS engine (KaniTTS, OuteTTS, or Parler-TTS)
|
|
53
|
+
* rather than the single-graph base text loader. Mirrors the routing used by
|
|
54
|
+
* `WebGPUEngine.speak()` / `Gerbil.ensureNativeTTSEngine`:
|
|
55
|
+
* - Parler → encoder-decoder (`ParlerTTSForConditionalGeneration`)
|
|
56
|
+
* - OuteTTS → Qwen3-0.6B codec-LM
|
|
57
|
+
* - Kani → conv-backbone codec-LM (`KaniTTS2ForCausalLM`, or the Apache
|
|
58
|
+
* default which is a plain `Lfm2ForCausalLM` — hence the repo-name
|
|
59
|
+
* gate; the architecture string alone does not identify it).
|
|
60
|
+
* At `create()` time only the repo is known (the architecture is discovered
|
|
61
|
+
* during load), so the repo-name signals below cover all three DEFAULT_MODELS
|
|
62
|
+
* and conventionally-named TTS repos; the architecture arg is honored when a
|
|
63
|
+
* caller already has it.
|
|
64
|
+
*/
|
|
65
|
+
function isTTSRepo(repo, architecture) {
|
|
66
|
+
const r = repo ?? "";
|
|
67
|
+
const a = architecture ?? "";
|
|
68
|
+
return r === DEFAULT_MODELS.tts || r === DEFAULT_MODELS.ttsOute || r === DEFAULT_MODELS.ttsParler || /parler/i.test(r) || /parler/i.test(a) || /outetts/i.test(r) || /oute/i.test(a) || a === "KaniTTS2ForCausalLM" || /kani-tts/i.test(r) || /\btts\b/i.test(r);
|
|
69
|
+
}
|
|
50
70
|
/** Resolve the model repo for a set of options, falling back to the defaults. */
|
|
51
71
|
function resolveDefaultRepo(opts) {
|
|
52
72
|
if (opts.repo) return opts.repo;
|
|
@@ -56,5 +76,5 @@ function resolveDefaultRepo(opts) {
|
|
|
56
76
|
}
|
|
57
77
|
|
|
58
78
|
//#endregion
|
|
59
|
-
export { resolveDefaultRepo as i, OUTETTS_ASSETS as n, OUTETTS_PRESET_VOICES as r, DEFAULT_MODELS as t };
|
|
60
|
-
//# sourceMappingURL=defaults-
|
|
79
|
+
export { resolveDefaultRepo as a, isTTSRepo as i, OUTETTS_ASSETS as n, OUTETTS_PRESET_VOICES as r, DEFAULT_MODELS as t };
|
|
80
|
+
//# sourceMappingURL=defaults-DfGx4d1m.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults-
|
|
1
|
+
{"version":3,"file":"defaults-DfGx4d1m.mjs","names":[],"sources":["../src/gpu/defaults.ts"],"sourcesContent":["/**\n * Default model per capability. Kept in its own tiny module (no heavy imports)\n * so the React hooks can resolve defaults without statically pulling in the GPU\n * engine — they import the engine dynamically to stay light.\n */\nexport const DEFAULT_MODELS = {\n /** Text generation (also the vision-capable checkpoint). */\n text: \"mlx-community/Qwen3.5-0.8B-4bit\",\n /** Image understanding — same checkpoint, vision tower built on demand. */\n vision: \"mlx-community/Qwen3.5-0.8B-4bit\",\n /** Text embeddings. */\n embedding: \"mlx-community/embeddinggemma-300m-4bit\",\n /** Text-to-speech (Apache-2.0; LFM2-350M backbone + NanoCodec). Small/fast default. */\n tts: \"nineninesix/kani-tts-450m-0.2-ft\",\n /**\n * Selectable many-voices TTS (OuteTTS-1.0-0.6B: Qwen3-0.6B codec-LM + DAC.speech).\n * Pass this as the `repo`/`model` to engine.speak()/useTTS to route to OuteTTS.\n */\n ttsOute: \"OuteAI/OuteTTS-1.0-0.6B\",\n /**\n * Selectable describe-your-voice TTS (Parler-TTS-mini-v1: Flan-T5 encoder +\n * cross-attending decoder LM + dac_44khz). Pass this as the `repo`/`model` to\n * engine.speak()/useTTS with a `describeVoice` natural-language description.\n */\n ttsParler: \"parler-tts/parler-tts-mini-v1\",\n /** Speech-to-text. */\n stt: \"UsefulSensors/moonshine-base\",\n} as const;\n\n/**\n * OuteTTS auxiliary assets. The DAC.speech codec ships only `.pth` (non-safetensors),\n * so the folded weights (prep-dac-speech.py output) and the preset speaker JSONs are\n * hosted on the Cloudflare R2 model mirror (same public host the engine reads via\n * GERBIL_MODEL_BASE — range + CORS, free egress, no redirect). Override via the OuteTTS\n * options when self-hosting.\n */\nconst OUTETTS_ASSET_BASE =\n \"https://pub-0522ecec25fc412bb35a523f3e3f63c6.r2.dev/tryhamster/gerbil-outetts-assets\";\nexport const OUTETTS_ASSETS = {\n /** Folded DAC.speech.v1.0 encoder+decoder weights (prep-dac-speech.py output). */\n codecWeightsURL: `${OUTETTS_ASSET_BASE}/dac-speech-folded.safetensors`,\n /** Base URL for the preset speaker JSONs (`{name}.json`). */\n speakersBaseURL: `${OUTETTS_ASSET_BASE}/speakers`,\n /** The default preset voice. */\n defaultVoice: \"en-female-1-neutral\",\n} as const;\n\n/**\n * Bundled OuteTTS preset voices.\n *\n * Provenance (honest labelling):\n * - `en-female-1-neutral` is the ONE AUTHENTIC OuteAI voice — the OuteTTS v3 bundled\n * default speaker (default_speakers/en-female-1-neutral), copied verbatim.\n * - `gerbil-voice-2..6` are DERIVED voices: distinct timbres produced by running\n * pitch/tempo-varied renderings of that authentic clip back through the REAL\n * DAC.speech encode + prosody pipeline (scripts/engine/stage-outetts-assets.py).\n * They are genuine DAC-encoded OuteSpeakers, but they are NOT OuteAI's own\n * `en-male-*` voices, so they are not labelled as such. (Earlier builds mislabelled\n * them as `en-male-2-neutral` etc.; renamed for honesty.)\n */\nexport const OUTETTS_PRESET_VOICES = [\n \"en-female-1-neutral\",\n \"gerbil-voice-2\",\n \"gerbil-voice-3\",\n \"gerbil-voice-4\",\n \"gerbil-voice-5\",\n \"gerbil-voice-6\",\n] as const;\n\n/**\n * True when `repo`/`architecture` identify a text-to-speech checkpoint that must\n * run through a dedicated native TTS engine (KaniTTS, OuteTTS, or Parler-TTS)\n * rather than the single-graph base text loader. Mirrors the routing used by\n * `WebGPUEngine.speak()` / `Gerbil.ensureNativeTTSEngine`:\n * - Parler → encoder-decoder (`ParlerTTSForConditionalGeneration`)\n * - OuteTTS → Qwen3-0.6B codec-LM\n * - Kani → conv-backbone codec-LM (`KaniTTS2ForCausalLM`, or the Apache\n * default which is a plain `Lfm2ForCausalLM` — hence the repo-name\n * gate; the architecture string alone does not identify it).\n * At `create()` time only the repo is known (the architecture is discovered\n * during load), so the repo-name signals below cover all three DEFAULT_MODELS\n * and conventionally-named TTS repos; the architecture arg is honored when a\n * caller already has it.\n */\nexport function isTTSRepo(repo?: string, architecture?: string): boolean {\n const r = repo ?? \"\";\n const a = architecture ?? \"\";\n return (\n r === DEFAULT_MODELS.tts ||\n r === DEFAULT_MODELS.ttsOute ||\n r === DEFAULT_MODELS.ttsParler ||\n /parler/i.test(r) ||\n /parler/i.test(a) ||\n /outetts/i.test(r) ||\n /oute/i.test(a) ||\n a === \"KaniTTS2ForCausalLM\" ||\n /kani-tts/i.test(r) ||\n /\\btts\\b/i.test(r)\n );\n}\n\n/** Resolve the model repo for a set of options, falling back to the defaults. */\nexport function resolveDefaultRepo(opts: {\n repo?: string;\n embedding?: boolean;\n enableVision?: boolean;\n}): string {\n if (opts.repo) return opts.repo;\n if (opts.embedding) return DEFAULT_MODELS.embedding;\n if (opts.enableVision) return DEFAULT_MODELS.vision;\n return DEFAULT_MODELS.text;\n}\n"],"mappings":";;;;;;AAKA,MAAa,iBAAiB;CAE5B,MAAM;CAEN,QAAQ;CAER,WAAW;CAEX,KAAK;CAKL,SAAS;CAMT,WAAW;CAEX,KAAK;CACN;;;;;;;;AASD,MAAM,qBACJ;AACF,MAAa,iBAAiB;CAE5B,iBAAiB,GAAG,mBAAmB;CAEvC,iBAAiB,GAAG,mBAAmB;CAEvC,cAAc;CACf;;;;;;;;;;;;;;AAeD,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;CACA;CACA;CACD;;;;;;;;;;;;;;;;AAiBD,SAAgB,UAAU,MAAe,cAAgC;CACvE,MAAM,IAAI,QAAQ;CAClB,MAAM,IAAI,gBAAgB;AAC1B,QACE,MAAM,eAAe,OACrB,MAAM,eAAe,WACrB,MAAM,eAAe,aACrB,UAAU,KAAK,EAAE,IACjB,UAAU,KAAK,EAAE,IACjB,WAAW,KAAK,EAAE,IAClB,QAAQ,KAAK,EAAE,IACf,MAAM,yBACN,YAAY,KAAK,EAAE,IACnB,WAAW,KAAK,EAAE;;;AAKtB,SAAgB,mBAAmB,MAIxB;AACT,KAAI,KAAK,KAAM,QAAO,KAAK;AAC3B,KAAI,KAAK,UAAW,QAAO,eAAe;AAC1C,KAAI,KAAK,aAAc,QAAO,eAAe;AAC7C,QAAO,eAAe"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../outetts-CAL3_K3j.mjs";
|
|
2
2
|
import { d as GerbilConfig } from "../types-BzbBDoaP.mjs";
|
|
3
|
-
import "../index-
|
|
4
|
-
import { t as Gerbil } from "../gerbil-
|
|
3
|
+
import "../index-DqJMofyU.mjs";
|
|
4
|
+
import { t as Gerbil } from "../gerbil-CaAGG2VP.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/frameworks/next.d.ts
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as OuteSpeaker } from "./outetts-CAL3_K3j.mjs";
|
|
2
2
|
import { A as SpeakResult, C as PreloadOptions, D as SessionStats, E as SearchResult, I as TranscribeOptions, L as TranscribeResult, M as StreamingTranscriptionSession, N as SystemInfo, O as SimilarityResult, T as STTModelConfig, _ as LoadSTTOptions, a as EmbedResult, d as GerbilConfig, g as LoadOptions, h as JsonOptions, i as EmbedOptions, j as StreamingTranscriptionOptions, k as SpeakOptions, l as GenerateOptions, t as AudioChunk, u as GenerateResult, v as LoadTTSOptions, y as ModelConfig, z as VoiceInfo } from "./types-BzbBDoaP.mjs";
|
|
3
|
-
import { a as GenerateObjectOptions, o as GenerateObjectResult } from "./index-
|
|
3
|
+
import { a as GenerateObjectOptions, o as GenerateObjectResult } from "./index-DqJMofyU.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/core/gerbil.d.ts
|
|
6
6
|
|
|
@@ -543,4 +543,4 @@ declare class Gerbil {
|
|
|
543
543
|
}
|
|
544
544
|
//#endregion
|
|
545
545
|
export { Gerbil as t };
|
|
546
|
-
//# sourceMappingURL=gerbil-
|
|
546
|
+
//# sourceMappingURL=gerbil-CaAGG2VP.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gerbil-
|
|
1
|
+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u/hooks.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../outetts-CAL3_K3j.mjs";
|
|
2
|
-
import { J as DEFAULT_MODELS, X as OUTETTS_PRESET_VOICES, n as AgentTool, t as AgentStep } from "../index-
|
|
2
|
+
import { J as DEFAULT_MODELS, X as OUTETTS_PRESET_VOICES, n as AgentTool, t as AgentStep } from "../index-DqJMofyU.mjs";
|
|
3
3
|
import { c as MemorySearchResult, d as RecallOptions, f as RecallResult, m as SearchOptions, s as MemoryRecord, t as AddOptions } from "../types-CIcNt_XS.mjs";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
package/dist/gpu/hooks.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as resolveDefaultRepo, r as OUTETTS_PRESET_VOICES, t as DEFAULT_MODELS } from "../defaults-DfGx4d1m.mjs";
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
4
|
|
package/dist/gpu/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as OuteSpeakerWord, c as buildOutePromptString, i as OuteSpeaker, l as loadOuteSpeaker, n as OuteSpeakOptions, o as OuteTTS, r as OuteSpeakResult, s as OuteTTSOptions, t as OuteDType } from "../outetts-CAL3_K3j.mjs";
|
|
2
|
-
import { $ as
|
|
3
|
-
export { AdapterConfig, AdapterSource, AgentStep, AgentTool, ChatMessage, DEFAULT_MODELS, EmbedOptions, EncodeImageResult, Executor, GEMMA4_IMAGE_PROCESSOR, GPUDiagnosticResult, Gemma4VisionGraphInfo, Gemma4VisionGridConfig, Gemma4VisionPositionTensors, GenerateObjectOptions, GenerateObjectResult, GenerateOptions, GenerateResult, GraphDType, ImageProcessorConfig, IntegrityCheckEntry, IntegrityCheckResult, KVDType, KaniDType, KaniTTS, KaniTTSOptions, KvMode, LoRADelta, LoadedKaniTTS, LoadedMoonshine, MOONSHINE_REMAINING_WORK, ModelArchConfig, ModelCapabilities, MoonshineEncoderExecutor, MoonshineSTT, MoonshineSTTOptions, OUTETTS_ASSETS, OUTETTS_PRESET_VOICES, ObjectSchema, ObjectValidator, OuteDType, OuteSpeakOptions, OuteSpeakResult, OuteSpeaker, OuteSpeakerWord, OuteTTS, OuteTTSOptions, ParlerSpeakOptions, ParlerSpeakResult, ParlerTTS, ParlerTTSOptions, PreprocessedImage, QWEN3_5_IMAGE_PROCESSOR, SamplingParams, SpeakOptions, SpeakResult, Tokenizer, TranscribeOptions, TranscribeResult, VisionExecutor, VisionGridConfig, VisionInputs, VisionPositionTensors, WebGPUEngine, WebGPUEngineOptions, applyLoRAToStore, audioTokensToCodes, audioTokensToDacCodes, buildGemma4PoolMatrix, buildGemma4PosEmbeds, buildGemma4RotaryCosSin, buildGemma4VisionPositionTensors, buildLoRADeltas, buildMRoPECosSin, buildMRoPEPositionIds, buildOutePromptString, buildPosEmbeds, buildPositionIds, buildRotaryCosSin, buildVisionPositionTensors, createDefaultHFKeyMapper, dacOutputLength, dequantizeGemma4VisionProjection, dequantizeMLXProjection, fetchAdapter, generateDacSpeechDecoderGraph, generateGemma4VisionGraph, generateKaniTtsGraph, generateMoonshineDecoderGraph, generateMoonshineEncoderGraph, generateNanoCodecDecoderGraph, generateOuteTtsBackboneGraph, generateQwen3_5VisionGraph, initGPU, loadKaniTTS, loadModel, loadMoonshine, loadOuteSpeaker, moonshineEncoderFrames, mropeFreqDims, parseKaniConfig, parseMoonshineConfig, parseOuteTtsConfig, patchGemma4VisionClips, preprocessImage, preprocessImageGemma4, quantizeKaniBackbone, resolveDefaultRepo, resolveGemma4VisionInfo, smartResize };
|
|
2
|
+
import { $ as GEMMA4_IMAGE_PROCESSOR, A as generateDacSpeechDecoderGraph, At as AdapterConfig, B as generateNanoCodecDecoderGraph, Bt as SpeakResult, C as TranscribeOptions, Ct as LoadedMoonshine, D as generateQwen3_5VisionGraph, Dt as quantizeKaniBackbone, E as Executor, Et as loadMoonshine, F as generateMoonshineEncoderGraph, Ft as fetchAdapter, G as generateGemma4VisionGraph, Gt as KvMode, H as Gemma4VisionGraphInfo, Ht as initGPU, I as moonshineEncoderFrames, It as KaniDType, J as DEFAULT_MODELS, Jt as createDefaultHFKeyMapper, K as patchGemma4VisionClips, Kt as ModelArchConfig, L as parseMoonshineConfig, Lt as KaniTTS, M as parseOuteTtsConfig, Mt as LoRADelta, N as MOONSHINE_REMAINING_WORK, Nt as applyLoRAToStore, O as audioTokensToDacCodes, Ot as ChatMessage, P as generateMoonshineDecoderGraph, Pt as buildLoRADeltas, Q as resolveDefaultRepo, R as audioTokensToCodes, Rt as KaniTTSOptions, S as MoonshineSTTOptions, St as LoadedKaniTTS, T as MoonshineEncoderExecutor, Tt as loadModel, U as dequantizeGemma4VisionProjection, Ut as GraphDType, V as parseKaniConfig, Vt as GPUDiagnosticResult, W as dequantizeMLXProjection, Wt as KVDType, X as OUTETTS_PRESET_VOICES, Y as OUTETTS_ASSETS, Z as isTTSRepo, _ as ParlerSpeakOptions, _t as mropeFreqDims, a as GenerateObjectOptions, at as VisionGridConfig, b as ParlerTTSOptions, bt as smartResize, c as GenerateResult, ct as buildGemma4PosEmbeds, d as ObjectSchema, dt as buildMRoPECosSin, et as Gemma4VisionGridConfig, f as ObjectValidator, ft as buildMRoPEPositionIds, g as VisionInputs, gt as buildVisionPositionTensors, h as VisionExecutor, ht as buildRotaryCosSin, i as EncodeImageResult, it as QWEN3_5_IMAGE_PROCESSOR, j as generateOuteTtsBackboneGraph, jt as AdapterSource, k as dacOutputLength, kt as Tokenizer, l as IntegrityCheckEntry, lt as buildGemma4RotaryCosSin, m as WebGPUEngineOptions, mt as buildPositionIds, n as AgentTool, nt as ImageProcessorConfig, o as GenerateObjectResult, ot as VisionPositionTensors, p as WebGPUEngine, pt as buildPosEmbeds, q as resolveGemma4VisionInfo, qt as ModelCapabilities, r as EmbedOptions, rt as PreprocessedImage, s as GenerateOptions, st as buildGemma4PoolMatrix, t as AgentStep, tt as Gemma4VisionPositionTensors, u as IntegrityCheckResult, ut as buildGemma4VisionPositionTensors, v as ParlerSpeakResult, vt as preprocessImage, w as TranscribeResult, wt as loadKaniTTS, x as MoonshineSTT, xt as SamplingParams, y as ParlerTTS, yt as preprocessImageGemma4, z as generateKaniTtsGraph, zt as SpeakOptions } from "../index-DqJMofyU.mjs";
|
|
3
|
+
export { AdapterConfig, AdapterSource, AgentStep, AgentTool, ChatMessage, DEFAULT_MODELS, EmbedOptions, EncodeImageResult, Executor, GEMMA4_IMAGE_PROCESSOR, GPUDiagnosticResult, Gemma4VisionGraphInfo, Gemma4VisionGridConfig, Gemma4VisionPositionTensors, GenerateObjectOptions, GenerateObjectResult, GenerateOptions, GenerateResult, GraphDType, ImageProcessorConfig, IntegrityCheckEntry, IntegrityCheckResult, KVDType, KaniDType, KaniTTS, KaniTTSOptions, KvMode, LoRADelta, LoadedKaniTTS, LoadedMoonshine, MOONSHINE_REMAINING_WORK, ModelArchConfig, ModelCapabilities, MoonshineEncoderExecutor, MoonshineSTT, MoonshineSTTOptions, OUTETTS_ASSETS, OUTETTS_PRESET_VOICES, ObjectSchema, ObjectValidator, OuteDType, OuteSpeakOptions, OuteSpeakResult, OuteSpeaker, OuteSpeakerWord, OuteTTS, OuteTTSOptions, ParlerSpeakOptions, ParlerSpeakResult, ParlerTTS, ParlerTTSOptions, PreprocessedImage, QWEN3_5_IMAGE_PROCESSOR, SamplingParams, SpeakOptions, SpeakResult, Tokenizer, TranscribeOptions, TranscribeResult, VisionExecutor, VisionGridConfig, VisionInputs, VisionPositionTensors, WebGPUEngine, WebGPUEngineOptions, applyLoRAToStore, audioTokensToCodes, audioTokensToDacCodes, buildGemma4PoolMatrix, buildGemma4PosEmbeds, buildGemma4RotaryCosSin, buildGemma4VisionPositionTensors, buildLoRADeltas, buildMRoPECosSin, buildMRoPEPositionIds, buildOutePromptString, buildPosEmbeds, buildPositionIds, buildRotaryCosSin, buildVisionPositionTensors, createDefaultHFKeyMapper, dacOutputLength, dequantizeGemma4VisionProjection, dequantizeMLXProjection, fetchAdapter, generateDacSpeechDecoderGraph, generateGemma4VisionGraph, generateKaniTtsGraph, generateMoonshineDecoderGraph, generateMoonshineEncoderGraph, generateNanoCodecDecoderGraph, generateOuteTtsBackboneGraph, generateQwen3_5VisionGraph, initGPU, isTTSRepo, loadKaniTTS, loadModel, loadMoonshine, loadOuteSpeaker, moonshineEncoderFrames, mropeFreqDims, parseKaniConfig, parseMoonshineConfig, parseOuteTtsConfig, patchGemma4VisionClips, preprocessImage, preprocessImageGemma4, quantizeKaniBackbone, resolveDefaultRepo, resolveGemma4VisionInfo, smartResize };
|
package/dist/gpu/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as resolveDefaultRepo, i as isTTSRepo, n as OUTETTS_ASSETS, r as OUTETTS_PRESET_VOICES, t as DEFAULT_MODELS } from "../defaults-DfGx4d1m.mjs";
|
|
2
2
|
import { E as generateNanoCodecDecoderGraph, M as parseKaniConfig, R as createDefaultHFKeyMapper, T as generateKaniTtsGraph, _ as moonshineEncoderFrames, g as generateMoonshineEncoderGraph, h as generateMoonshineDecoderGraph, m as MOONSHINE_REMAINING_WORK, v as parseMoonshineConfig, x as audioTokensToCodes } from "../architectures-DmZMEFsA.mjs";
|
|
3
|
-
import { A as dequantizeGemma4VisionProjection, C as audioTokensToDacCodes, D as parseOuteTtsConfig, E as generateOuteTtsBackboneGraph, M as generateGemma4VisionGraph, N as patchGemma4VisionClips, O as KaniTTS, P as resolveGemma4VisionInfo, S as loadOuteSpeaker, T as generateDacSpeechDecoderGraph, _ as smartResize, a as buildGemma4PosEmbeds, b as OuteTTS, c as buildMRoPECosSin, d as buildPositionIds, f as buildRotaryCosSin, g as preprocessImageGemma4, h as preprocessImage, i as buildGemma4PoolMatrix, j as dequantizeMLXProjection, k as generateQwen3_5VisionGraph, l as buildMRoPEPositionIds, m as mropeFreqDims, n as GEMMA4_IMAGE_PROCESSOR, o as buildGemma4RotaryCosSin, p as buildVisionPositionTensors, r as QWEN3_5_IMAGE_PROCESSOR, s as buildGemma4VisionPositionTensors, t as WebGPUEngine, u as buildPosEmbeds, v as VisionExecutor, w as dacOutputLength, x as buildOutePromptString, y as ParlerTTS } from "../gpu-
|
|
3
|
+
import { A as dequantizeGemma4VisionProjection, C as audioTokensToDacCodes, D as parseOuteTtsConfig, E as generateOuteTtsBackboneGraph, M as generateGemma4VisionGraph, N as patchGemma4VisionClips, O as KaniTTS, P as resolveGemma4VisionInfo, S as loadOuteSpeaker, T as generateDacSpeechDecoderGraph, _ as smartResize, a as buildGemma4PosEmbeds, b as OuteTTS, c as buildMRoPECosSin, d as buildPositionIds, f as buildRotaryCosSin, g as preprocessImageGemma4, h as preprocessImage, i as buildGemma4PoolMatrix, j as dequantizeMLXProjection, k as generateQwen3_5VisionGraph, l as buildMRoPEPositionIds, m as mropeFreqDims, n as GEMMA4_IMAGE_PROCESSOR, o as buildGemma4RotaryCosSin, p as buildVisionPositionTensors, r as QWEN3_5_IMAGE_PROCESSOR, s as buildGemma4VisionPositionTensors, t as WebGPUEngine, u as buildPosEmbeds, v as VisionExecutor, w as dacOutputLength, x as buildOutePromptString, y as ParlerTTS } from "../gpu-BCfd_K38.mjs";
|
|
4
4
|
import { T as initGPU, a as loadModel, f as Tokenizer, g as Executor, h as fetchAdapter, i as loadKaniTTS, m as buildLoRADeltas, n as MoonshineEncoderExecutor, o as loadMoonshine, p as applyLoRAToStore, t as MoonshineSTT, u as quantizeKaniBackbone } from "../moonshine-stt-CgDXoLFd.mjs";
|
|
5
5
|
|
|
6
|
-
export { DEFAULT_MODELS, Executor, GEMMA4_IMAGE_PROCESSOR, KaniTTS, MOONSHINE_REMAINING_WORK, MoonshineEncoderExecutor, MoonshineSTT, OUTETTS_ASSETS, OUTETTS_PRESET_VOICES, OuteTTS, ParlerTTS, QWEN3_5_IMAGE_PROCESSOR, Tokenizer, VisionExecutor, WebGPUEngine, applyLoRAToStore, audioTokensToCodes, audioTokensToDacCodes, buildGemma4PoolMatrix, buildGemma4PosEmbeds, buildGemma4RotaryCosSin, buildGemma4VisionPositionTensors, buildLoRADeltas, buildMRoPECosSin, buildMRoPEPositionIds, buildOutePromptString, buildPosEmbeds, buildPositionIds, buildRotaryCosSin, buildVisionPositionTensors, createDefaultHFKeyMapper, dacOutputLength, dequantizeGemma4VisionProjection, dequantizeMLXProjection, fetchAdapter, generateDacSpeechDecoderGraph, generateGemma4VisionGraph, generateKaniTtsGraph, generateMoonshineDecoderGraph, generateMoonshineEncoderGraph, generateNanoCodecDecoderGraph, generateOuteTtsBackboneGraph, generateQwen3_5VisionGraph, initGPU, loadKaniTTS, loadModel, loadMoonshine, loadOuteSpeaker, moonshineEncoderFrames, mropeFreqDims, parseKaniConfig, parseMoonshineConfig, parseOuteTtsConfig, patchGemma4VisionClips, preprocessImage, preprocessImageGemma4, quantizeKaniBackbone, resolveDefaultRepo, resolveGemma4VisionInfo, smartResize };
|
|
6
|
+
export { DEFAULT_MODELS, Executor, GEMMA4_IMAGE_PROCESSOR, KaniTTS, MOONSHINE_REMAINING_WORK, MoonshineEncoderExecutor, MoonshineSTT, OUTETTS_ASSETS, OUTETTS_PRESET_VOICES, OuteTTS, ParlerTTS, QWEN3_5_IMAGE_PROCESSOR, Tokenizer, VisionExecutor, WebGPUEngine, applyLoRAToStore, audioTokensToCodes, audioTokensToDacCodes, buildGemma4PoolMatrix, buildGemma4PosEmbeds, buildGemma4RotaryCosSin, buildGemma4VisionPositionTensors, buildLoRADeltas, buildMRoPECosSin, buildMRoPEPositionIds, buildOutePromptString, buildPosEmbeds, buildPositionIds, buildRotaryCosSin, buildVisionPositionTensors, createDefaultHFKeyMapper, dacOutputLength, dequantizeGemma4VisionProjection, dequantizeMLXProjection, fetchAdapter, generateDacSpeechDecoderGraph, generateGemma4VisionGraph, generateKaniTtsGraph, generateMoonshineDecoderGraph, generateMoonshineEncoderGraph, generateNanoCodecDecoderGraph, generateOuteTtsBackboneGraph, generateQwen3_5VisionGraph, initGPU, isTTSRepo, loadKaniTTS, loadModel, loadMoonshine, loadOuteSpeaker, moonshineEncoderFrames, mropeFreqDims, parseKaniConfig, parseMoonshineConfig, parseOuteTtsConfig, patchGemma4VisionClips, preprocessImage, preprocessImageGemma4, quantizeKaniBackbone, resolveDefaultRepo, resolveGemma4VisionInfo, smartResize };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as resolveDefaultRepo, i as isTTSRepo, n as OUTETTS_ASSETS, r as OUTETTS_PRESET_VOICES, t as DEFAULT_MODELS } from "./defaults-DfGx4d1m.mjs";
|
|
2
2
|
import { A as kaniSinTensor, C as computeKaniPositions, D as kaniAttentionLayerIndices, E as generateNanoCodecDecoderGraph, F as CANONICAL_KEYS, I as DTYPE_BYTES, L as GEMMA4_VIS_KEYS, M as parseKaniConfig, N as DEFAULT_GROUP_SIZE, O as kaniCosTensor, S as buildKaniLayerCosSin, T as generateKaniTtsGraph, a as PARLER_DAC_LATENT_DIM, b as KANI_START_OF_HUMAN, c as PARLER_SAMPLE_RATE, d as generateParlerEncoderGraph, f as parseParlerConfig, i as PARLER_DAC_DECODER_DIM, k as kaniLayerAlpha, l as buildT5RelativeBias, o as PARLER_DECODER_RATES, p as revertDelayPattern, r as PARLER_BOS_TOKEN_ID, s as PARLER_EOS_TOKEN_ID, u as generateParlerDecoderGraph, x as audioTokensToCodes, y as KANI_END_OF_HUMAN } from "./architectures-DmZMEFsA.mjs";
|
|
3
3
|
import { C as destroyBuffers, E as verifyGPU, S as createUniformBuffer, T as initGPU, _ as KERNEL_REGISTRY, a as loadModel, b as createBindGroup, c as loadParlerTTS, d as remapPrunedToken, g as Executor, h as fetchAdapter, i as loadKaniTTS, l as quantizeBackboneInt4, m as buildLoRADeltas, r as createKeyMapperForArch, s as loadOuteTTS, u as quantizeKaniBackbone, v as MATMUL_BIAS_F16C_SPEC, w as getOrCreatePipeline, x as createStorageBuffer, y as clearPipelineCache } from "./moonshine-stt-CgDXoLFd.mjs";
|
|
4
4
|
|
|
@@ -5101,9 +5101,22 @@ function parseAgentToolCall(text) {
|
|
|
5101
5101
|
return null;
|
|
5102
5102
|
}
|
|
5103
5103
|
var WebGPUEngine = class WebGPUEngine {
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5104
|
+
_ctx;
|
|
5105
|
+
_executor;
|
|
5106
|
+
_tokenizer;
|
|
5107
|
+
get ctx() {
|
|
5108
|
+
if (!this._ctx) throw new Error(WebGPUEngine.TTS_LITE_ERROR);
|
|
5109
|
+
return this._ctx;
|
|
5110
|
+
}
|
|
5111
|
+
get executor() {
|
|
5112
|
+
if (!this._executor) throw new Error(WebGPUEngine.TTS_LITE_ERROR);
|
|
5113
|
+
return this._executor;
|
|
5114
|
+
}
|
|
5115
|
+
get tokenizer() {
|
|
5116
|
+
if (!this._tokenizer) throw new Error(WebGPUEngine.TTS_LITE_ERROR);
|
|
5117
|
+
return this._tokenizer;
|
|
5118
|
+
}
|
|
5119
|
+
static TTS_LITE_ERROR = "This engine was created for a TTS checkpoint; base-model ops (generate/embed/describeImage) are unavailable. Use speak() / encodeSpeaker().";
|
|
5107
5120
|
_destroyed = false;
|
|
5108
5121
|
_isEmbedding;
|
|
5109
5122
|
/** HF architecture string (e.g. "Gemma3TextModel", "Qwen3ForCausalLM"). */
|
|
@@ -5155,16 +5168,25 @@ var WebGPUEngine = class WebGPUEngine {
|
|
|
5155
5168
|
_genQueueTail = Promise.resolve();
|
|
5156
5169
|
/** Model capabilities (text, vision, moe). */
|
|
5157
5170
|
capabilities;
|
|
5158
|
-
/** Model architecture config. */
|
|
5159
|
-
|
|
5171
|
+
/** Model architecture config (null on a TTS-only lite engine). */
|
|
5172
|
+
_config;
|
|
5173
|
+
/** Model architecture config. Throws on a TTS-only lite engine. */
|
|
5174
|
+
get config() {
|
|
5175
|
+
if (!this._config) throw new Error(WebGPUEngine.TTS_LITE_ERROR);
|
|
5176
|
+
return this._config;
|
|
5177
|
+
}
|
|
5160
5178
|
constructor(ctx, executor, tokenizer, graph, opts, vision) {
|
|
5161
|
-
this.
|
|
5162
|
-
this.
|
|
5163
|
-
this.
|
|
5164
|
-
this.capabilities = graph
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5179
|
+
this._ctx = ctx;
|
|
5180
|
+
this._executor = executor;
|
|
5181
|
+
this._tokenizer = tokenizer;
|
|
5182
|
+
this.capabilities = graph?.capabilities ?? {
|
|
5183
|
+
text: true,
|
|
5184
|
+
vision: false,
|
|
5185
|
+
moe: false
|
|
5186
|
+
};
|
|
5187
|
+
this._config = graph?.config ?? null;
|
|
5188
|
+
this._isEmbedding = graph?.outputs.includes("embedding") ?? false;
|
|
5189
|
+
this._architecture = graph?.architecture ?? "";
|
|
5168
5190
|
this.visionExecutor = vision?.executor ?? null;
|
|
5169
5191
|
this.visionConfig = vision?.config ?? null;
|
|
5170
5192
|
this.visionPosEmbedTable = vision?.posEmbedTable ?? null;
|
|
@@ -5281,6 +5303,7 @@ var WebGPUEngine = class WebGPUEngine {
|
|
|
5281
5303
|
...options,
|
|
5282
5304
|
repo: resolveDefaultRepo(options)
|
|
5283
5305
|
};
|
|
5306
|
+
if (isTTSRepo(options.repo)) return WebGPUEngine._buildTTSLite(options);
|
|
5284
5307
|
const ctx = await initGPU();
|
|
5285
5308
|
try {
|
|
5286
5309
|
return await WebGPUEngine._buildFromContext(ctx, options);
|
|
@@ -5291,6 +5314,21 @@ var WebGPUEngine = class WebGPUEngine {
|
|
|
5291
5314
|
throw err;
|
|
5292
5315
|
}
|
|
5293
5316
|
}
|
|
5317
|
+
/**
|
|
5318
|
+
* Build a lightweight TTS-only engine: no GPU device is initialized and no base
|
|
5319
|
+
* text graph is loaded. It stores the create() options; the first `speak()`
|
|
5320
|
+
* (or `encodeSpeaker()`) lazily builds the dedicated native TTS engine —
|
|
5321
|
+
* {@link KaniTTS}, {@link OuteTTS}, or {@link ParlerTTS} — which brings its own
|
|
5322
|
+
* GPU device and weights. Base-model ops throw {@link WebGPUEngine.TTS_LITE_ERROR}.
|
|
5323
|
+
*/
|
|
5324
|
+
static _buildTTSLite(options) {
|
|
5325
|
+
return new WebGPUEngine(null, null, null, null, {
|
|
5326
|
+
multimodalGraph: false,
|
|
5327
|
+
rawConfig: {},
|
|
5328
|
+
maxSeqLen: options.maxSeqLen ?? 2048,
|
|
5329
|
+
createOptions: options
|
|
5330
|
+
}, null);
|
|
5331
|
+
}
|
|
5294
5332
|
static async _buildFromContext(ctx, options) {
|
|
5295
5333
|
const isBrowser = typeof navigator !== "undefined" && typeof location !== "undefined";
|
|
5296
5334
|
const isSafari = isBrowser && /Safari/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent);
|
|
@@ -6685,13 +6723,15 @@ var WebGPUEngine = class WebGPUEngine {
|
|
|
6685
6723
|
destroy() {
|
|
6686
6724
|
if (this._destroyed) return;
|
|
6687
6725
|
this._destroyed = true;
|
|
6688
|
-
this.
|
|
6726
|
+
this._executor?.destroy();
|
|
6689
6727
|
this._kaniTTS?.destroy();
|
|
6690
6728
|
this._outeTTS?.destroy();
|
|
6691
6729
|
this._parlerTTS?.destroy();
|
|
6692
6730
|
this.visionExecutor?.destroy();
|
|
6693
|
-
|
|
6694
|
-
|
|
6731
|
+
if (this._ctx) {
|
|
6732
|
+
clearPipelineCache(this._ctx.device);
|
|
6733
|
+
this._ctx.device.destroy();
|
|
6734
|
+
}
|
|
6695
6735
|
}
|
|
6696
6736
|
checkDestroyed() {
|
|
6697
6737
|
if (this._destroyed) throw new Error("WebGPUEngine has been destroyed");
|
|
@@ -6722,4 +6762,4 @@ var WebGPUEngine = class WebGPUEngine {
|
|
|
6722
6762
|
|
|
6723
6763
|
//#endregion
|
|
6724
6764
|
export { dequantizeGemma4VisionProjection as A, audioTokensToDacCodes as C, parseOuteTtsConfig as D, generateOuteTtsBackboneGraph as E, generateGemma4VisionGraph as M, patchGemma4VisionClips as N, KaniTTS as O, resolveGemma4VisionInfo as P, loadOuteSpeaker as S, generateDacSpeechDecoderGraph as T, smartResize as _, buildGemma4PosEmbeds as a, OuteTTS as b, buildMRoPECosSin as c, buildPositionIds as d, buildRotaryCosSin as f, preprocessImageGemma4 as g, preprocessImage as h, buildGemma4PoolMatrix as i, dequantizeMLXProjection as j, generateQwen3_5VisionGraph as k, buildMRoPEPositionIds as l, mropeFreqDims as m, GEMMA4_IMAGE_PROCESSOR as n, buildGemma4RotaryCosSin as o, buildVisionPositionTensors as p, QWEN3_5_IMAGE_PROCESSOR as r, buildGemma4VisionPositionTensors as s, WebGPUEngine as t, buildPosEmbeds as u, VisionExecutor as v, dacOutputLength as w, buildOutePromptString as x, ParlerTTS as y };
|
|
6725
|
-
//# sourceMappingURL=gpu-
|
|
6765
|
+
//# sourceMappingURL=gpu-BCfd_K38.mjs.map
|