@qvac/inference 0.21.1 → 0.22.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 +30 -1
- package/README.md +44 -1
- package/dist/api/assess-model-fit.d.ts +4 -4
- package/dist/api/assess-model-fit.js +4 -4
- package/dist/api/audio-gen.d.ts +4 -1
- package/dist/api/audio-gen.js +4 -1
- package/dist/api/batch-completion.js +1 -1
- package/dist/api/completion-stream.js +1 -1
- package/dist/api/decide.d.ts +26 -0
- package/dist/api/decide.js +26 -0
- package/dist/api/get-model-info.d.ts +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/text-to-speech.d.ts +1 -0
- package/dist/api/text-to-speech.js +15 -19
- package/dist/api/transcribe.js +5 -2
- package/dist/api/video-request.d.ts +5 -5
- package/dist/api/video.d.ts +5 -4
- package/dist/api/video.js +5 -4
- package/dist/errors/index.d.ts +3 -0
- package/dist/errors/index.js +5 -0
- package/dist/handlers/assess-model-fit.d.ts +5 -3
- package/dist/handlers/assess-model-fit.js +80 -28
- package/dist/handlers/get-loaded-model-info.js +1 -2
- package/dist/handlers/load-model/safe-fetch.js +5 -6
- package/dist/handlers/registry.d.ts +3 -1
- package/dist/handlers/registry.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/logging/logger.js +1 -1
- package/dist/logging/utils.js +1 -1
- package/dist/models/registry/models.d.ts +563 -816
- package/dist/models/registry/models.js +2873 -3110
- package/dist/models/registry/resource-profiles.d.ts +1 -2
- package/dist/models/registry/resource-profiles.js +203 -2
- package/dist/plugins/builtin/asr-ggml/config.d.ts +7 -1
- package/dist/plugins/builtin/asr-ggml/config.js +6 -0
- package/dist/plugins/builtin/asr-ggml/logging.d.ts +1 -1
- package/dist/plugins/builtin/audiogen-ggml/config.d.ts +1 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-edit-stream.js +28 -10
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-input.d.ts +27 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-input.js +23 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.js +6 -27
- package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +147 -60
- package/dist/plugins/builtin/audiogen-ggml/plugin.js +1 -0
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.d.ts +40 -24
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.js +1 -1
- package/dist/plugins/builtin/ggml-classification/plugin.d.ts +4 -4
- package/dist/plugins/builtin/ggml-ocr/params.d.ts +18 -0
- package/dist/plugins/builtin/ggml-ocr/params.js +37 -0
- package/dist/plugins/builtin/ggml-ocr/plugin.d.ts +18 -10
- package/dist/plugins/builtin/ggml-ocr/plugin.js +16 -38
- package/dist/plugins/builtin/ggml-vla/plugin.d.ts +21 -14
- package/dist/plugins/builtin/ggml-vla/plugin.js +1 -1
- package/dist/plugins/builtin/index.d.ts +2 -0
- package/dist/plugins/builtin/index.js +2 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.d.ts +9 -7
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +109 -189
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.d.ts +32 -90
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.js +60 -211
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-state.d.ts +2 -49
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-state.js +2 -46
- package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +185 -87
- package/dist/plugins/builtin/llamacpp-completion/plugin.js +4 -5
- package/dist/plugins/builtin/llamacpp-completion/transform.js +1 -1
- package/dist/plugins/builtin/llamacpp-decision/helpers.d.ts +6 -0
- package/dist/plugins/builtin/llamacpp-decision/helpers.js +97 -0
- package/dist/plugins/builtin/llamacpp-decision/ops/decide.d.ts +91 -0
- package/dist/plugins/builtin/llamacpp-decision/ops/decide.js +129 -0
- package/dist/plugins/builtin/llamacpp-decision/plugin.d.ts +216 -0
- package/dist/plugins/builtin/llamacpp-decision/plugin.js +43 -0
- package/dist/plugins/builtin/llamacpp-embedding/plugin.d.ts +12 -5
- package/dist/plugins/builtin/llamacpp-embedding/plugin.js +1 -1
- package/dist/plugins/builtin/llamacpp-embedding/transform.js +3 -0
- package/dist/plugins/builtin/moss-transcribe/plugin.d.ts +143 -0
- package/dist/plugins/builtin/moss-transcribe/plugin.js +96 -0
- package/dist/plugins/builtin/nmtcpp-translation/load-files.d.ts +6 -0
- package/dist/plugins/builtin/nmtcpp-translation/load-files.js +70 -0
- package/dist/plugins/builtin/nmtcpp-translation/plugin.d.ts +25 -13
- package/dist/plugins/builtin/nmtcpp-translation/plugin.js +9 -73
- package/dist/plugins/builtin/parakeet-transcription/plugin.d.ts +52 -31
- package/dist/plugins/builtin/parakeet-transcription/plugin.js +18 -3
- package/dist/plugins/builtin/sdcpp-generation/ops/video.js +10 -6
- package/dist/plugins/builtin/sdcpp-generation/ops/world.d.ts +2 -2
- package/dist/plugins/builtin/sdcpp-generation/ops/world.js +1 -1
- package/dist/plugins/builtin/sdcpp-generation/plugin.d.ts +59 -33
- package/dist/plugins/builtin/sdcpp-generation/plugin.js +12 -9
- package/dist/plugins/builtin/tts-ggml/ops/moss-options.d.ts +22 -0
- package/dist/plugins/builtin/tts-ggml/ops/moss-options.js +79 -0
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.js +4 -1
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.js +17 -5
- package/dist/plugins/builtin/tts-ggml/plugin.d.ts +164 -29
- package/dist/plugins/builtin/tts-ggml/plugin.js +38 -1
- package/dist/plugins/builtin/whispercpp-transcription/plugin.d.ts +58 -35
- package/dist/plugins/builtin/whispercpp-transcription/plugin.js +6 -2
- package/dist/plugins/ops/kv-cache-utils.d.ts +1 -1
- package/dist/plugins/ops/kv-cache-utils.js +10 -25
- package/dist/plugins/ops/load-model.js +21 -16
- package/dist/plugins/ops/transcribe.js +17 -1
- package/dist/registry.js +1 -0
- package/dist/resources/model-fit/assess.d.ts +15 -23
- package/dist/resources/model-fit/assess.js +207 -271
- package/dist/resources/model-fit/fit-stub/fetch-fit-stub.d.ts +3 -1
- package/dist/resources/model-fit/fit-stub/fetch-fit-stub.js +6 -1
- package/dist/resources/model-fit/fit-stub/project-fit-from-load.js +2 -0
- package/dist/resources/model-fit/fit-stub/resolve-load-from-stubs.d.ts +5 -3
- package/dist/resources/model-fit/fit-stub/resolve-load-from-stubs.js +9 -1
- package/dist/resources/model-fit/floor.d.ts +10 -10
- package/dist/resources/model-fit/floor.js +13 -13
- package/dist/resources/model-fit/kv-cache.d.ts +23 -0
- package/dist/resources/model-fit/kv-cache.js +85 -0
- package/dist/resources/model-fit/native-probe/advisory-fit.d.ts +11 -6
- package/dist/resources/model-fit/native-probe/advisory-fit.js +12 -27
- package/dist/resources/model-fit/native-probe/child-engine-fit.js +8 -0
- package/dist/resources/model-fit/native-probe/classify-fit.js +32 -1
- package/dist/resources/model-fit/native-probe/create-fit-request.d.ts +4 -1
- package/dist/resources/model-fit/native-probe/create-fit-request.js +24 -14
- package/dist/resources/model-fit/native-probe/engine-fit.d.ts +14 -0
- package/dist/resources/model-fit/native-probe/engine-fit.js +1 -1
- package/dist/resources/model-fit/native-probe/engines/asr.d.ts +4 -0
- package/dist/resources/model-fit/native-probe/engines/asr.js +23 -0
- package/dist/resources/model-fit/native-probe/engines/audiogen.js +29 -1
- package/dist/resources/model-fit/native-probe/engines/diffusion.js +16 -6
- package/dist/resources/model-fit/native-probe/engines/llama.d.ts +0 -1
- package/dist/resources/model-fit/native-probe/engines/llama.js +19 -123
- package/dist/resources/model-fit/native-probe/engines/nmt.d.ts +8 -0
- package/dist/resources/model-fit/native-probe/engines/nmt.js +11 -0
- package/dist/resources/model-fit/native-probe/engines/ocr.d.ts +9 -0
- package/dist/resources/model-fit/native-probe/engines/ocr.js +13 -0
- package/dist/resources/model-fit/native-probe/engines/tts.d.ts +2 -0
- package/dist/resources/model-fit/native-probe/engines/tts.js +49 -3
- package/dist/resources/model-fit/native-probe/run-in-process-fit.d.ts +5 -3
- package/dist/resources/model-fit/native-probe/run-in-process-fit.js +38 -23
- package/dist/resources/model-fit/platform.d.ts +4 -4
- package/dist/resources/model-fit/platform.js +6 -8
- package/dist/resources/model-fit/types.d.ts +3 -117
- package/dist/rpc/inventory.js +5 -7
- package/dist/runtime/env.d.ts +0 -2
- package/dist/runtime/env.js +2 -9
- package/dist/runtime/model-config-utils.js +6 -1
- package/dist/runtime/request-context.d.ts +1 -1
- package/dist/runtime/request-context.js +8 -0
- package/dist/runtime/state.js +5 -0
- package/dist/schemas/assess-model-fit.d.ts +100 -43
- package/dist/schemas/assess-model-fit.js +66 -29
- package/dist/schemas/audio-gen.d.ts +186 -18
- package/dist/schemas/audio-gen.js +180 -48
- package/dist/schemas/batch-completion-stream.d.ts +202 -34
- package/dist/schemas/bci-config.d.ts +2 -0
- package/dist/schemas/bci.d.ts +23 -2
- package/dist/schemas/cancel.d.ts +5 -0
- package/dist/schemas/cancel.js +1 -0
- package/dist/schemas/common.d.ts +1083 -158
- package/dist/schemas/common.js +5 -2
- package/dist/schemas/completion-stream.d.ts +232 -37
- package/dist/schemas/completion-stream.js +64 -20
- package/dist/schemas/config.d.ts +477 -12
- package/dist/schemas/config.js +21 -1
- package/dist/schemas/decision.d.ts +602 -0
- package/dist/schemas/decision.js +205 -0
- package/dist/schemas/download-asset.d.ts +7 -3
- package/dist/schemas/engine-addon-map.d.ts +7 -0
- package/dist/schemas/engine-addon-map.js +23 -3
- package/dist/schemas/errors.d.ts +1 -0
- package/dist/schemas/errors.js +5 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/llamacpp-config.d.ts +42 -2
- package/dist/schemas/llamacpp-config.js +27 -0
- package/dist/schemas/load-model.d.ts +5247 -1309
- package/dist/schemas/load-model.js +88 -9
- package/dist/schemas/model-config-schemas.d.ts +233 -8
- package/dist/schemas/model-config-schemas.js +4 -1
- package/dist/schemas/model-fit-policy.d.ts +17 -0
- package/dist/schemas/model-fit-policy.js +17 -0
- package/dist/schemas/model-info.d.ts +20 -2
- package/dist/schemas/model-info.js +2 -1
- package/dist/schemas/model-resource-profile.d.ts +3 -4
- package/dist/schemas/model-resource-profile.js +1 -4
- package/dist/schemas/model-src-utils.d.ts +10 -2
- package/dist/schemas/model-types.d.ts +10 -1
- package/dist/schemas/model-types.js +3 -0
- package/dist/schemas/ocr.d.ts +74 -0
- package/dist/schemas/ocr.js +42 -0
- package/dist/schemas/plugin.d.ts +8 -2
- package/dist/schemas/plugin.js +6 -0
- package/dist/schemas/profiling.d.ts +4 -4
- package/dist/schemas/registry.d.ts +26 -0
- package/dist/schemas/registry.js +3 -0
- package/dist/schemas/reload-config.d.ts +10 -2
- package/dist/schemas/rpc-server.js +3 -3
- package/dist/schemas/sdcpp-config.d.ts +26 -0
- package/dist/schemas/sdcpp-config.js +8 -7
- package/dist/schemas/system-resources.d.ts +4 -4
- package/dist/schemas/text-to-speech.d.ts +402 -3
- package/dist/schemas/text-to-speech.js +129 -11
- package/dist/schemas/tools.d.ts +13 -4
- package/dist/schemas/tools.js +18 -6
- package/dist/schemas/transcription-config.d.ts +15 -0
- package/dist/schemas/transcription-config.js +38 -3
- package/dist/schemas/transcription.d.ts +46 -4
- package/dist/schemas/transcription.js +51 -4
- package/dist/schemas/translation-config.d.ts +30 -10
- package/dist/schemas/vla.d.ts +9 -2
- package/dist/schemas/vla.js +9 -5
- package/dist/surface.d.ts +1 -1
- package/dist/surface.js +1 -1
- package/dist/utils/addon-responses.d.ts +1 -0
- package/dist/utils/asr-events.d.ts +1 -0
- package/dist/utils/asr-events.js +2 -1
- package/dist/utils/cache/types.d.ts +7 -0
- package/dist/utils/mcp-adapter.js +12 -8
- package/dist/utils/tool-helpers.d.ts +1 -1
- package/dist/utils/tool-helpers.js +20 -52
- package/dist/utils/tools/parsers/dsml.js +8 -5
- package/dist/utils/tools/parsers/qwen35.js +7 -4
- package/dist/utils/tools/shared.d.ts +3 -0
- package/dist/utils/tools/shared.js +62 -0
- package/dist/utils/transcribe-metadata.d.ts +8 -1
- package/dist/utils/transcribe-metadata.js +13 -3
- package/dist/utils/tts-stats.d.ts +1 -0
- package/package.json +41 -32
- package/dist/resources/model-fit/calibration/darwin-arm64.d.ts +0 -8
- package/dist/resources/model-fit/calibration/darwin-arm64.js +0 -36
- package/dist/resources/model-fit/calibration/darwin-x64.d.ts +0 -8
- package/dist/resources/model-fit/calibration/darwin-x64.js +0 -38
- package/dist/resources/model-fit/calibration/fit.d.ts +0 -73
- package/dist/resources/model-fit/calibration/fit.js +0 -152
- package/dist/resources/model-fit/calibration/index.d.ts +0 -37
- package/dist/resources/model-fit/calibration/index.js +0 -75
- package/dist/resources/model-fit/calibration/linux-arm64.d.ts +0 -8
- package/dist/resources/model-fit/calibration/linux-arm64.js +0 -38
- package/dist/resources/model-fit/calibration/linux-x64-vulkan.d.ts +0 -8
- package/dist/resources/model-fit/calibration/linux-x64-vulkan.js +0 -39
- package/dist/resources/model-fit/calibration/linux-x64.d.ts +0 -8
- package/dist/resources/model-fit/calibration/linux-x64.js +0 -38
- package/dist/resources/model-fit/calibration/win32-x64-vulkan-shared.d.ts +0 -8
- package/dist/resources/model-fit/calibration/win32-x64-vulkan-shared.js +0 -39
- package/dist/resources/model-fit/calibration/win32-x64-vulkan.d.ts +0 -8
- package/dist/resources/model-fit/calibration/win32-x64-vulkan.js +0 -36
- package/dist/resources/model-fit/calibration/win32-x64.d.ts +0 -8
- package/dist/resources/model-fit/calibration/win32-x64.js +0 -38
- package/dist/resources/model-fit/estimators/llm.d.ts +0 -46
- package/dist/resources/model-fit/estimators/llm.js +0 -222
- package/dist/resources/model-fit/estimators/whisper.d.ts +0 -10
- package/dist/resources/model-fit/estimators/whisper.js +0 -76
|
@@ -4,8 +4,7 @@ import type { ModelResourceProfile } from '../../schemas/model-resource-profile.
|
|
|
4
4
|
* `sha256Checksum` — the same checksum a model constant carries.
|
|
5
5
|
*
|
|
6
6
|
* Facts only: on-disk bytes plus the GGUF transformer shape when the registry
|
|
7
|
-
* captured it.
|
|
8
|
-
* a re-calibration never regenerates this file.
|
|
7
|
+
* captured it.
|
|
9
8
|
*/
|
|
10
9
|
export declare const MODEL_RESOURCE_PROFILES: Readonly<Record<string, ModelResourceProfile>>;
|
|
11
10
|
/**
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
* `sha256Checksum` — the same checksum a model constant carries.
|
|
6
6
|
*
|
|
7
7
|
* Facts only: on-disk bytes plus the GGUF transformer shape when the registry
|
|
8
|
-
* captured it.
|
|
9
|
-
* a re-calibration never regenerates this file.
|
|
8
|
+
* captured it.
|
|
10
9
|
*/
|
|
11
10
|
export const MODEL_RESOURCE_PROFILES = {
|
|
12
11
|
'002fe52ee02cef4e76f8114bfd810bb64aefb44a218666b01872a46e5c0349fc': {
|
|
@@ -247,6 +246,11 @@ export const MODEL_RESOURCE_PROFILES = {
|
|
|
247
246
|
engine: 'whispercpp-transcription',
|
|
248
247
|
artifactBytes: 43537450
|
|
249
248
|
},
|
|
249
|
+
'08456d9e22cd9a323c0364d98375f3746d6e68507ebb705cd46438c534c7a3a1': {
|
|
250
|
+
schemaVersion: 1,
|
|
251
|
+
engine: 'parakeet-transcription',
|
|
252
|
+
artifactBytes: 107012128
|
|
253
|
+
},
|
|
250
254
|
'089d75c52f4b7ffc56ba998ffc50aae89fcafc755f9e7208aacca281dca6c2ae': {
|
|
251
255
|
schemaVersion: 1,
|
|
252
256
|
engine: 'llamacpp-completion',
|
|
@@ -349,6 +353,11 @@ export const MODEL_RESOURCE_PROFILES = {
|
|
|
349
353
|
contextLength: 262144
|
|
350
354
|
}
|
|
351
355
|
},
|
|
356
|
+
'0d3bf5ede840d7eb150492e14f417efb6304be27f973bb5848ce001c44f3bc79': {
|
|
357
|
+
schemaVersion: 1,
|
|
358
|
+
engine: 'audiogen-ggml',
|
|
359
|
+
artifactBytes: 6432916800
|
|
360
|
+
},
|
|
352
361
|
'0db772702235b02d1f29abafb7a49ed77e54c60245b3a46e90716e74263aedd6': {
|
|
353
362
|
schemaVersion: 1,
|
|
354
363
|
engine: 'nmtcpp-translation',
|
|
@@ -385,6 +394,31 @@ export const MODEL_RESOURCE_PROFILES = {
|
|
|
385
394
|
engine: 'nmtcpp-translation',
|
|
386
395
|
artifactBytes: 4945796
|
|
387
396
|
},
|
|
397
|
+
'1270162611a0c7074cc2a376380ddaca825702c62bebf2433baf42269de246fe': {
|
|
398
|
+
schemaVersion: 1,
|
|
399
|
+
engine: 'llamacpp-embedding',
|
|
400
|
+
artifactBytes: 449919008,
|
|
401
|
+
ggufFacts: {
|
|
402
|
+
architecture: 'laya',
|
|
403
|
+
blockCount: 28,
|
|
404
|
+
headCount: 16,
|
|
405
|
+
headCountKv: 16,
|
|
406
|
+
keyLength: 64,
|
|
407
|
+
valueLength: 64,
|
|
408
|
+
embeddingLength: 1024,
|
|
409
|
+
contextLength: 8192,
|
|
410
|
+
slidingWindow: 128,
|
|
411
|
+
assumptions: [
|
|
412
|
+
'head_count_kv absent — assumed equal to head_count (no GQA)',
|
|
413
|
+
'key_length/value_length absent — derived from embedding_length / head_count'
|
|
414
|
+
]
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
'12cd8d2b3e5c5b2b71a59c02300257e7846cba5c1efe30e900e22c2c719d41dc': {
|
|
418
|
+
schemaVersion: 1,
|
|
419
|
+
engine: 'audiogen-ggml',
|
|
420
|
+
artifactBytes: 3493811520
|
|
421
|
+
},
|
|
388
422
|
'12f55292aaa411d81250234fb3ccc6cb5842a86f426e5cf2d08807bf2938f7cd': {
|
|
389
423
|
schemaVersion: 1,
|
|
390
424
|
engine: 'nmtcpp-translation',
|
|
@@ -1024,6 +1058,26 @@ export const MODEL_RESOURCE_PROFILES = {
|
|
|
1024
1058
|
contextLength: 40960
|
|
1025
1059
|
}
|
|
1026
1060
|
},
|
|
1061
|
+
'33dac85dcf22281d56e3a4fcb78def3c8fa59131c208af45a2e5c57cbe268de4': {
|
|
1062
|
+
schemaVersion: 1,
|
|
1063
|
+
engine: 'llamacpp-embedding',
|
|
1064
|
+
artifactBytes: 844548128,
|
|
1065
|
+
ggufFacts: {
|
|
1066
|
+
architecture: 'laya',
|
|
1067
|
+
blockCount: 28,
|
|
1068
|
+
headCount: 16,
|
|
1069
|
+
headCountKv: 16,
|
|
1070
|
+
keyLength: 64,
|
|
1071
|
+
valueLength: 64,
|
|
1072
|
+
embeddingLength: 1024,
|
|
1073
|
+
contextLength: 8192,
|
|
1074
|
+
slidingWindow: 128,
|
|
1075
|
+
assumptions: [
|
|
1076
|
+
'head_count_kv absent — assumed equal to head_count (no GQA)',
|
|
1077
|
+
'key_length/value_length absent — derived from embedding_length / head_count'
|
|
1078
|
+
]
|
|
1079
|
+
}
|
|
1080
|
+
},
|
|
1027
1081
|
'352a63a3919aa1e714a7ea76065b0fb00f02f7979c8eef03cd53dbb7c1133160': {
|
|
1028
1082
|
schemaVersion: 1,
|
|
1029
1083
|
engine: 'nmtcpp-translation',
|
|
@@ -1529,6 +1583,11 @@ export const MODEL_RESOURCE_PROFILES = {
|
|
|
1529
1583
|
artifactBytes: 22864691,
|
|
1530
1584
|
assumptions: ['artifactBytes sums 4 companion-set files']
|
|
1531
1585
|
},
|
|
1586
|
+
'4a0b77c718c57f0cbb59841a47b0a18b3a249406646793ec10ce63f0d3fe8078': {
|
|
1587
|
+
schemaVersion: 1,
|
|
1588
|
+
engine: 'moss-transcribe',
|
|
1589
|
+
artifactBytes: 1826866496
|
|
1590
|
+
},
|
|
1532
1591
|
'4a37286742244a130548b79823c9707bc0e56f373361e2cb56402f82e862c2b0': {
|
|
1533
1592
|
schemaVersion: 1,
|
|
1534
1593
|
engine: 'nmtcpp-translation',
|
|
@@ -1808,12 +1867,52 @@ export const MODEL_RESOURCE_PROFILES = {
|
|
|
1808
1867
|
engine: 'nmtcpp-translation',
|
|
1809
1868
|
artifactBytes: 3421640
|
|
1810
1869
|
},
|
|
1870
|
+
'59a61f840e6f125c25037f7cc0363efafee1aeea3394b504d25551b4bda5a219': {
|
|
1871
|
+
schemaVersion: 1,
|
|
1872
|
+
engine: 'llamacpp-embedding',
|
|
1873
|
+
artifactBytes: 348425664,
|
|
1874
|
+
ggufFacts: {
|
|
1875
|
+
architecture: 'laya',
|
|
1876
|
+
blockCount: 22,
|
|
1877
|
+
headCount: 12,
|
|
1878
|
+
headCountKv: 12,
|
|
1879
|
+
keyLength: 64,
|
|
1880
|
+
valueLength: 64,
|
|
1881
|
+
embeddingLength: 768,
|
|
1882
|
+
contextLength: 8192,
|
|
1883
|
+
slidingWindow: 128,
|
|
1884
|
+
assumptions: [
|
|
1885
|
+
'head_count_kv absent — assumed equal to head_count (no GQA)',
|
|
1886
|
+
'key_length/value_length absent — derived from embedding_length / head_count'
|
|
1887
|
+
]
|
|
1888
|
+
}
|
|
1889
|
+
},
|
|
1811
1890
|
'59ae659f9bb63e4f81f474fe3c03d3f4499434b5f9e779fab7c12a45f31fd562': {
|
|
1812
1891
|
schemaVersion: 1,
|
|
1813
1892
|
engine: 'nmtcpp-translation',
|
|
1814
1893
|
artifactBytes: 49603799,
|
|
1815
1894
|
assumptions: ['artifactBytes sums 5 companion-set files']
|
|
1816
1895
|
},
|
|
1896
|
+
'5a44e3f8060290ab40b390a83242961aeab7af62913853530a4342bc5ec9ebe8': {
|
|
1897
|
+
schemaVersion: 1,
|
|
1898
|
+
engine: 'llamacpp-embedding',
|
|
1899
|
+
artifactBytes: 844548256,
|
|
1900
|
+
ggufFacts: {
|
|
1901
|
+
architecture: 'laya',
|
|
1902
|
+
blockCount: 28,
|
|
1903
|
+
headCount: 16,
|
|
1904
|
+
headCountKv: 16,
|
|
1905
|
+
keyLength: 64,
|
|
1906
|
+
valueLength: 64,
|
|
1907
|
+
embeddingLength: 1024,
|
|
1908
|
+
contextLength: 8192,
|
|
1909
|
+
slidingWindow: 128,
|
|
1910
|
+
assumptions: [
|
|
1911
|
+
'head_count_kv absent — assumed equal to head_count (no GQA)',
|
|
1912
|
+
'key_length/value_length absent — derived from embedding_length / head_count'
|
|
1913
|
+
]
|
|
1914
|
+
}
|
|
1915
|
+
},
|
|
1817
1916
|
'5a6b15da0f483b9e320a5b86b787ad1831953dfaa706e2c5d91de830ea70d784': {
|
|
1818
1917
|
schemaVersion: 1,
|
|
1819
1918
|
engine: 'llamacpp-completion',
|
|
@@ -2129,6 +2228,11 @@ export const MODEL_RESOURCE_PROFILES = {
|
|
|
2129
2228
|
engine: 'nmtcpp-translation',
|
|
2130
2229
|
artifactBytes: 3572436
|
|
2131
2230
|
},
|
|
2231
|
+
'69b481694bc2933432a865c05b579db762f90f340a64d0c51e50464b867686f1': {
|
|
2232
|
+
schemaVersion: 1,
|
|
2233
|
+
engine: 'moss-transcribe',
|
|
2234
|
+
artifactBytes: 641393984
|
|
2235
|
+
},
|
|
2132
2236
|
'69f00c782198dc911062c9d1222fe39c85a6f954211a96796050aec3f0980ed7': {
|
|
2133
2237
|
schemaVersion: 1,
|
|
2134
2238
|
engine: 'tts-ggml',
|
|
@@ -2321,6 +2425,26 @@ export const MODEL_RESOURCE_PROFILES = {
|
|
|
2321
2425
|
engine: 'tts-ggml',
|
|
2322
2426
|
artifactBytes: 398497088
|
|
2323
2427
|
},
|
|
2428
|
+
'72d5e753a4861f5532e0e3e065b9644ff6f6894efef82fa74af0898fa93ba899': {
|
|
2429
|
+
schemaVersion: 1,
|
|
2430
|
+
engine: 'llamacpp-embedding',
|
|
2431
|
+
artifactBytes: 449919104,
|
|
2432
|
+
ggufFacts: {
|
|
2433
|
+
architecture: 'laya',
|
|
2434
|
+
blockCount: 28,
|
|
2435
|
+
headCount: 16,
|
|
2436
|
+
headCountKv: 16,
|
|
2437
|
+
keyLength: 64,
|
|
2438
|
+
valueLength: 64,
|
|
2439
|
+
embeddingLength: 1024,
|
|
2440
|
+
contextLength: 8192,
|
|
2441
|
+
slidingWindow: 128,
|
|
2442
|
+
assumptions: [
|
|
2443
|
+
'head_count_kv absent — assumed equal to head_count (no GQA)',
|
|
2444
|
+
'key_length/value_length absent — derived from embedding_length / head_count'
|
|
2445
|
+
]
|
|
2446
|
+
}
|
|
2447
|
+
},
|
|
2324
2448
|
'735881c99ff303e55eb2e92a3b86762523d5dd1a4797b2574b851062051426ee': {
|
|
2325
2449
|
schemaVersion: 1,
|
|
2326
2450
|
engine: 'nmtcpp-translation',
|
|
@@ -2368,6 +2492,11 @@ export const MODEL_RESOURCE_PROFILES = {
|
|
|
2368
2492
|
engine: 'nmtcpp-translation',
|
|
2369
2493
|
artifactBytes: 965095
|
|
2370
2494
|
},
|
|
2495
|
+
'75605e251bdc3da9662c6cb01fb8fb8fff5fe82b76c39719af7f042406f8ab0c': {
|
|
2496
|
+
schemaVersion: 1,
|
|
2497
|
+
engine: 'tts-ggml',
|
|
2498
|
+
artifactBytes: 1333086144
|
|
2499
|
+
},
|
|
2371
2500
|
'75e2a133676a82189b10fb1c55b5b32aedc6ede796dd6d8d7c1f901d20ebc7df': {
|
|
2372
2501
|
schemaVersion: 1,
|
|
2373
2502
|
engine: 'llamacpp-completion',
|
|
@@ -3512,6 +3641,22 @@ export const MODEL_RESOURCE_PROFILES = {
|
|
|
3512
3641
|
engine: 'parakeet-transcription',
|
|
3513
3642
|
artifactBytes: 408
|
|
3514
3643
|
},
|
|
3644
|
+
a8d18fdfb5429fa25f062c9915938eae6a309509cd089e86857d4544d5dd3fbf: {
|
|
3645
|
+
schemaVersion: 1,
|
|
3646
|
+
engine: 'tts-ggml',
|
|
3647
|
+
artifactBytes: 18198030464,
|
|
3648
|
+
ggufFacts: {
|
|
3649
|
+
architecture: 'moss-speech',
|
|
3650
|
+
blockCount: 32,
|
|
3651
|
+
headCount: 32,
|
|
3652
|
+
headCountKv: 8,
|
|
3653
|
+
keyLength: 128,
|
|
3654
|
+
valueLength: 128,
|
|
3655
|
+
embeddingLength: 4096,
|
|
3656
|
+
contextLength: 40960,
|
|
3657
|
+
assumptions: ['key_length/value_length absent — derived from embedding_length / head_count']
|
|
3658
|
+
}
|
|
3659
|
+
},
|
|
3515
3660
|
a8fbce44032eda4fdf6d098f4c3602fca309859a129f4cdb33d2709b48ba7d32: {
|
|
3516
3661
|
schemaVersion: 1,
|
|
3517
3662
|
engine: 'parakeet-transcription',
|
|
@@ -3522,6 +3667,21 @@ export const MODEL_RESOURCE_PROFILES = {
|
|
|
3522
3667
|
engine: 'nmtcpp-translation',
|
|
3523
3668
|
artifactBytes: 2228
|
|
3524
3669
|
},
|
|
3670
|
+
a91cf9758fab31bdd545b8d0fb3e7c05d15a00ab4e6641ee4ea1664d352399c3: {
|
|
3671
|
+
schemaVersion: 1,
|
|
3672
|
+
engine: 'tts-ggml',
|
|
3673
|
+
artifactBytes: 16716943744,
|
|
3674
|
+
ggufFacts: {
|
|
3675
|
+
architecture: 'moss-tts-delay',
|
|
3676
|
+
blockCount: 36,
|
|
3677
|
+
headCount: 32,
|
|
3678
|
+
headCountKv: 8,
|
|
3679
|
+
keyLength: 128,
|
|
3680
|
+
valueLength: 128,
|
|
3681
|
+
embeddingLength: 4096,
|
|
3682
|
+
contextLength: 40960
|
|
3683
|
+
}
|
|
3684
|
+
},
|
|
3525
3685
|
a9a124b6a5c1306393d6e32c55324a8d9189734cb8b31ef29c8e3836ce7a76d4: {
|
|
3526
3686
|
schemaVersion: 1,
|
|
3527
3687
|
engine: 'parakeet-transcription',
|
|
@@ -4166,6 +4326,11 @@ export const MODEL_RESOURCE_PROFILES = {
|
|
|
4166
4326
|
engine: 'whispercpp-transcription',
|
|
4167
4327
|
artifactBytes: 81768585
|
|
4168
4328
|
},
|
|
4329
|
+
c55e9e912a5e934f7fb9dc74e0d8b0e495c5fe6737bcffe0f325759417c4432c: {
|
|
4330
|
+
schemaVersion: 1,
|
|
4331
|
+
engine: 'moss-transcribe',
|
|
4332
|
+
artifactBytes: 980100416
|
|
4333
|
+
},
|
|
4169
4334
|
c577b9a86e7e048a0b7eada054f4dd79a56bbfa911fbdacf900ac5b567cbb7d9: {
|
|
4170
4335
|
schemaVersion: 1,
|
|
4171
4336
|
engine: 'whispercpp-transcription',
|
|
@@ -4664,6 +4829,22 @@ export const MODEL_RESOURCE_PROFILES = {
|
|
|
4664
4829
|
engine: 'nmtcpp-translation',
|
|
4665
4830
|
artifactBytes: 693697483
|
|
4666
4831
|
},
|
|
4832
|
+
dc1055984979d4a00d8d69fb70a5b79a75da3f8721d29abf3955f3d188426820: {
|
|
4833
|
+
schemaVersion: 1,
|
|
4834
|
+
engine: 'tts-ggml',
|
|
4835
|
+
artifactBytes: 9671141504,
|
|
4836
|
+
ggufFacts: {
|
|
4837
|
+
architecture: 'moss-speech',
|
|
4838
|
+
blockCount: 32,
|
|
4839
|
+
headCount: 32,
|
|
4840
|
+
headCountKv: 8,
|
|
4841
|
+
keyLength: 128,
|
|
4842
|
+
valueLength: 128,
|
|
4843
|
+
embeddingLength: 4096,
|
|
4844
|
+
contextLength: 40960,
|
|
4845
|
+
assumptions: ['key_length/value_length absent — derived from embedding_length / head_count']
|
|
4846
|
+
}
|
|
4847
|
+
},
|
|
4667
4848
|
dc235e4bfc4cdc25e0e1b36e07e29435b140861b4b94b8197bc715ddc7be912f: {
|
|
4668
4849
|
schemaVersion: 1,
|
|
4669
4850
|
engine: 'nmtcpp-translation',
|
|
@@ -4838,6 +5019,26 @@ export const MODEL_RESOURCE_PROFILES = {
|
|
|
4838
5019
|
engine: 'nmtcpp-translation',
|
|
4839
5020
|
artifactBytes: 4489412
|
|
4840
5021
|
},
|
|
5022
|
+
e658ac8a717089528a1f402caa6b91aec8a4059b76c9c35114a70ba32b2fb469: {
|
|
5023
|
+
schemaVersion: 1,
|
|
5024
|
+
engine: 'llamacpp-embedding',
|
|
5025
|
+
artifactBytes: 649973184,
|
|
5026
|
+
ggufFacts: {
|
|
5027
|
+
architecture: 'laya',
|
|
5028
|
+
blockCount: 22,
|
|
5029
|
+
headCount: 12,
|
|
5030
|
+
headCountKv: 12,
|
|
5031
|
+
keyLength: 64,
|
|
5032
|
+
valueLength: 64,
|
|
5033
|
+
embeddingLength: 768,
|
|
5034
|
+
contextLength: 8192,
|
|
5035
|
+
slidingWindow: 128,
|
|
5036
|
+
assumptions: [
|
|
5037
|
+
'head_count_kv absent — assumed equal to head_count (no GQA)',
|
|
5038
|
+
'key_length/value_length absent — derived from embedding_length / head_count'
|
|
5039
|
+
]
|
|
5040
|
+
}
|
|
5041
|
+
},
|
|
4841
5042
|
e661dfdd88aa9ff9606f237a60c910d97c2e710960199589579f628c5d8aa899: {
|
|
4842
5043
|
schemaVersion: 1,
|
|
4843
5044
|
engine: 'nmtcpp-translation',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type ASRGgml from '@qvac/asr-ggml';
|
|
2
|
-
import type { ParakeetConfig, WhisperConfig } from '../../../schemas/index.js';
|
|
2
|
+
import type { ParakeetConfig, WhisperConfig, MossTranscribeConfig } from '../../../schemas/index.js';
|
|
3
3
|
export declare function buildWhisperEngineConfig(config: WhisperConfig): {
|
|
4
4
|
miscConfig?: {
|
|
5
5
|
[k: string]: unknown;
|
|
@@ -29,3 +29,9 @@ export declare function buildParakeetReloadConfig(config: ParakeetConfig): {
|
|
|
29
29
|
[k: string]: unknown;
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
+
export declare function buildMossTranscribeEngineConfig(config: MossTranscribeConfig): {
|
|
33
|
+
engine: "moss-transcribe";
|
|
34
|
+
mossTranscribeConfig: {
|
|
35
|
+
[k: string]: unknown;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -44,3 +44,9 @@ export function buildParakeetReloadConfig(config) {
|
|
|
44
44
|
parakeetConfig: omitUndefined(config)
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
+
export function buildMossTranscribeEngineConfig(config) {
|
|
48
|
+
return {
|
|
49
|
+
engine: 'moss-transcribe',
|
|
50
|
+
mossTranscribeConfig: omitUndefined(config)
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ModelType } from '../../../schemas/index.js';
|
|
2
|
-
type AsrModelType = typeof ModelType.whispercppTranscription | typeof ModelType.parakeetTranscription;
|
|
2
|
+
type AsrModelType = typeof ModelType.whispercppTranscription | typeof ModelType.parakeetTranscription | typeof ModelType.mossTranscribe;
|
|
3
3
|
/**
|
|
4
4
|
* ASRGgml's native logger is process-global and cannot identify its originating
|
|
5
5
|
* model. Keep instance loggers on engine-specific namespaces so the logger
|
|
@@ -2,6 +2,7 @@ import { type ResolveContext } from '../../../schemas/index.js';
|
|
|
2
2
|
export declare function resolveAudioGenConfig(config: Record<string, unknown>, ctx: ResolveContext): Promise<{
|
|
3
3
|
config: {
|
|
4
4
|
engine: "minimax";
|
|
5
|
+
device?: "cpu" | "gpu" | "auto" | undefined;
|
|
5
6
|
inferenceSteps?: number | undefined;
|
|
6
7
|
cfgScale?: number | undefined;
|
|
7
8
|
useGPU?: boolean | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RepaintMode } from '@qvac/audiogen-ggml';
|
|
2
2
|
import { AUDIOGEN_INPUT_CHANNELS, AUDIOGEN_INPUT_SAMPLE_RATE } from '../../../../schemas/audio-gen.js';
|
|
3
|
-
import {
|
|
3
|
+
import { resolveAudioGenInputs } from './audio-gen-input.js';
|
|
4
4
|
import { streamAudioGenRun } from './audio-gen-run.js';
|
|
5
5
|
// The wire vocabulary is the addon's own enum values; the map keeps the
|
|
6
6
|
// string-enum typing honest instead of casting across the boundary.
|
|
@@ -13,13 +13,16 @@ export function audioEditStream(request) {
|
|
|
13
13
|
return streamAudioGenRun({
|
|
14
14
|
type: 'audioEditStream',
|
|
15
15
|
request,
|
|
16
|
-
async start(model, ctx) {
|
|
17
|
-
// The source
|
|
18
|
-
// never held by a request that fails on input
|
|
19
|
-
// one path where the addon demands normalized
|
|
20
|
-
// settles `[-1, 1]` here for raw and
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
async start(model, ctx, logger) {
|
|
17
|
+
// The source and reference are decoded before the run is admitted so
|
|
18
|
+
// the model slot is never held by a request that fails on input
|
|
19
|
+
// decoding. Editing is the one path where the addon demands normalized
|
|
20
|
+
// source samples, so the resolver settles `[-1, 1]` here for raw and
|
|
21
|
+
// decoded input alike; the reference only has to be finite.
|
|
22
|
+
const { sourceAudio, referenceAudio } = await resolveAudioGenInputs(request, {
|
|
23
|
+
modelId: request.modelId,
|
|
24
|
+
logger,
|
|
25
|
+
normalizedSource: true
|
|
23
26
|
});
|
|
24
27
|
if (ctx.signal.aborted)
|
|
25
28
|
return undefined;
|
|
@@ -27,13 +30,28 @@ export function audioEditStream(request) {
|
|
|
27
30
|
// turbo DiT, repaint ranges inside the source, ...); those throws
|
|
28
31
|
// surface as the request's error before any native work starts.
|
|
29
32
|
const session = model.edit({
|
|
30
|
-
pcm,
|
|
33
|
+
pcm: sourceAudio,
|
|
31
34
|
sampleRate: AUDIOGEN_INPUT_SAMPLE_RATE,
|
|
32
35
|
channels: AUDIOGEN_INPUT_CHANNELS
|
|
33
36
|
});
|
|
34
37
|
for (const operation of request.operations)
|
|
35
38
|
appendOperation(session, operation);
|
|
36
|
-
return session.run({
|
|
39
|
+
return session.run({
|
|
40
|
+
...(request.seed !== undefined && { seed: request.seed }),
|
|
41
|
+
...(referenceAudio && { referenceAudio }),
|
|
42
|
+
...(request.vocalLanguage !== undefined && { vocalLanguage: request.vocalLanguage }),
|
|
43
|
+
...(request.bpm !== undefined && { bpm: request.bpm }),
|
|
44
|
+
...(request.keyscale !== undefined && { keyscale: request.keyscale }),
|
|
45
|
+
...(request.timesignature !== undefined && { timesignature: request.timesignature }),
|
|
46
|
+
...(request.augmentCaptionWithMetadata !== undefined && {
|
|
47
|
+
augmentCaptionWithMetadata: request.augmentCaptionWithMetadata
|
|
48
|
+
}),
|
|
49
|
+
...(request.dcwEnabled !== undefined && { dcwEnabled: request.dcwEnabled }),
|
|
50
|
+
...(request.dcwScaler !== undefined && { dcwScaler: request.dcwScaler }),
|
|
51
|
+
...(request.dcwHighScaler !== undefined && { dcwHighScaler: request.dcwHighScaler }),
|
|
52
|
+
...(request.inferenceSteps !== undefined && { inferenceSteps: request.inferenceSteps }),
|
|
53
|
+
...(request.shift !== undefined && { shift: request.shift })
|
|
54
|
+
});
|
|
37
55
|
}
|
|
38
56
|
});
|
|
39
57
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type AudioGenAudioInput } from '../../../../schemas/audio-gen.js';
|
|
2
|
+
import type { Logger } from '../../../../logging/index.js';
|
|
2
3
|
export type AudioGenAudioInputName = 'referenceAudio' | 'sourceAudio';
|
|
3
4
|
/**
|
|
4
5
|
* Resolve a reference/source audio input into the interleaved stereo 48 kHz
|
|
@@ -25,3 +26,29 @@ export type AudioGenAudioInputName = 'referenceAudio' | 'sourceAudio';
|
|
|
25
26
|
export declare function resolveAudioGenPcm(input: AudioGenAudioInput, name: AudioGenAudioInputName, { requireNormalized }?: {
|
|
26
27
|
requireNormalized?: boolean;
|
|
27
28
|
}): Promise<Float32Array>;
|
|
29
|
+
export interface AudioGenAudioInputs {
|
|
30
|
+
referenceAudio?: AudioGenAudioInput | undefined;
|
|
31
|
+
sourceAudio?: AudioGenAudioInput | undefined;
|
|
32
|
+
}
|
|
33
|
+
export interface ResolvedAudioGenInputs {
|
|
34
|
+
referenceAudio: Float32Array | undefined;
|
|
35
|
+
sourceAudio: Float32Array | undefined;
|
|
36
|
+
}
|
|
37
|
+
export interface ResolveAudioGenInputsOptions {
|
|
38
|
+
modelId: string;
|
|
39
|
+
logger: Logger;
|
|
40
|
+
/** Hold the source to `[-1, 1]`, which only an edit requires; a reference never is. */
|
|
41
|
+
normalizedSource?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Decode a run's reference and source audio concurrently. When both fail, the
|
|
45
|
+
* source's failure is thrown and the reference's is logged, so neither
|
|
46
|
+
* diagnostic is lost. A request that always carries a source (an edit) gets
|
|
47
|
+
* it back decoded.
|
|
48
|
+
*/
|
|
49
|
+
export declare function resolveAudioGenInputs(inputs: AudioGenAudioInputs & {
|
|
50
|
+
sourceAudio: AudioGenAudioInput;
|
|
51
|
+
}, options: ResolveAudioGenInputsOptions): Promise<ResolvedAudioGenInputs & {
|
|
52
|
+
sourceAudio: Float32Array;
|
|
53
|
+
}>;
|
|
54
|
+
export declare function resolveAudioGenInputs(inputs: AudioGenAudioInputs, options: ResolveAudioGenInputsOptions): Promise<ResolvedAudioGenInputs>;
|
|
@@ -46,6 +46,29 @@ export async function resolveAudioGenPcm(input, name, { requireNormalized = fals
|
|
|
46
46
|
throw new InvalidAudioInputError(`${name} must be a file path or raw PCM bytes`);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
+
export async function resolveAudioGenInputs(inputs, { modelId, logger, normalizedSource = false }) {
|
|
50
|
+
const [source, reference] = await Promise.allSettled([
|
|
51
|
+
inputs.sourceAudio
|
|
52
|
+
? resolveAudioGenPcm(inputs.sourceAudio, 'sourceAudio', {
|
|
53
|
+
requireNormalized: normalizedSource
|
|
54
|
+
})
|
|
55
|
+
: Promise.resolve(undefined),
|
|
56
|
+
inputs.referenceAudio
|
|
57
|
+
? resolveAudioGenPcm(inputs.referenceAudio, 'referenceAudio')
|
|
58
|
+
: Promise.resolve(undefined)
|
|
59
|
+
]);
|
|
60
|
+
const failures = [source, reference].filter((result) => result.status === 'rejected');
|
|
61
|
+
if (failures.length > 0) {
|
|
62
|
+
for (const extra of failures.slice(1)) {
|
|
63
|
+
logger.warn(`[audiogen] additional audio input failure for modelId=${modelId}: ${extra.reason instanceof Error ? extra.reason.message : String(extra.reason)}`);
|
|
64
|
+
}
|
|
65
|
+
throw failures[0].reason;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
referenceAudio: reference.status === 'fulfilled' ? reference.value : undefined,
|
|
69
|
+
sourceAudio: source.status === 'fulfilled' ? source.value : undefined
|
|
70
|
+
};
|
|
71
|
+
}
|
|
49
72
|
async function statInput(filePath) {
|
|
50
73
|
try {
|
|
51
74
|
return await fs.promises.stat(filePath);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveAudioGenInputs } from './audio-gen-input.js';
|
|
2
2
|
import { streamAudioGenRun } from './audio-gen-run.js';
|
|
3
3
|
export function audioGenStream(request) {
|
|
4
4
|
return streamAudioGenRun({
|
|
@@ -7,7 +7,10 @@ export function audioGenStream(request) {
|
|
|
7
7
|
async start(model, ctx, logger) {
|
|
8
8
|
// Reference/source audio is decoded before the run is admitted so the
|
|
9
9
|
// model slot is never held by a request that fails on input decoding.
|
|
10
|
-
const { referenceAudio, sourceAudio } = await
|
|
10
|
+
const { referenceAudio, sourceAudio } = await resolveAudioGenInputs(request, {
|
|
11
|
+
modelId: request.modelId,
|
|
12
|
+
logger
|
|
13
|
+
});
|
|
11
14
|
if (ctx.signal.aborted)
|
|
12
15
|
return undefined;
|
|
13
16
|
return model.run(request.caption, {
|
|
@@ -34,6 +37,7 @@ export function audioGenStream(request) {
|
|
|
34
37
|
...(request.duration !== undefined && { duration: request.duration }),
|
|
35
38
|
...(request.maxFrames !== undefined && { maxFrames: request.maxFrames }),
|
|
36
39
|
...(request.inferenceSteps !== undefined && { inferenceSteps: request.inferenceSteps }),
|
|
40
|
+
...(request.shift !== undefined && { shift: request.shift }),
|
|
37
41
|
...(request.cfgScale !== undefined && { cfgScale: request.cfgScale }),
|
|
38
42
|
...(request.lmTemperature !== undefined && { lmTemperature: request.lmTemperature }),
|
|
39
43
|
...(request.lmTopP !== undefined && { lmTopP: request.lmTopP }),
|
|
@@ -59,28 +63,3 @@ export function audioGenStream(request) {
|
|
|
59
63
|
}
|
|
60
64
|
});
|
|
61
65
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Decode both optional audio inputs concurrently. When both fail, the first
|
|
64
|
-
* failure is thrown and the second is logged so neither diagnostic is lost.
|
|
65
|
-
*/
|
|
66
|
-
async function resolveAudioInputs(request, logger) {
|
|
67
|
-
const [reference, source] = await Promise.allSettled([
|
|
68
|
-
request.referenceAudio
|
|
69
|
-
? resolveAudioGenPcm(request.referenceAudio, 'referenceAudio')
|
|
70
|
-
: Promise.resolve(undefined),
|
|
71
|
-
request.sourceAudio
|
|
72
|
-
? resolveAudioGenPcm(request.sourceAudio, 'sourceAudio')
|
|
73
|
-
: Promise.resolve(undefined)
|
|
74
|
-
]);
|
|
75
|
-
const failures = [reference, source].filter((result) => result.status === 'rejected');
|
|
76
|
-
if (failures.length > 0) {
|
|
77
|
-
for (const extra of failures.slice(1)) {
|
|
78
|
-
logger.warn(`[audiogen] additional audio input failure for modelId=${request.modelId}: ${extra.reason instanceof Error ? extra.reason.message : String(extra.reason)}`);
|
|
79
|
-
}
|
|
80
|
-
throw failures[0].reason;
|
|
81
|
-
}
|
|
82
|
-
return {
|
|
83
|
-
referenceAudio: reference.status === 'fulfilled' ? reference.value : undefined,
|
|
84
|
-
sourceAudio: source.status === 'fulfilled' ? source.value : undefined
|
|
85
|
-
};
|
|
86
|
-
}
|