@qvac/inference 0.23.0 → 0.24.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 +60 -28
- package/README.md +3 -1
- package/dist/api/assess-model-fit.d.ts +14 -14
- package/dist/api/assess-model-fit.js +14 -14
- package/dist/api/audio-gen.d.ts +2 -2
- package/dist/api/audio-gen.js +135 -44
- package/dist/api/batch-completion.js +2 -1
- package/dist/api/calc-tokens.d.ts +30 -0
- package/dist/api/calc-tokens.js +41 -0
- package/dist/api/classify.d.ts +5 -2
- package/dist/api/classify.js +5 -2
- package/dist/api/completion-stream.d.ts +1 -1
- package/dist/api/completion-stream.js +2 -1
- package/dist/api/delete-cache.d.ts +7 -1
- package/dist/api/delete-cache.js +11 -1
- package/dist/api/diffusion.d.ts +14 -1
- package/dist/api/diffusion.js +14 -1
- package/dist/api/embed.d.ts +82 -29
- package/dist/api/embed.js +64 -18
- package/dist/api/get-model-info.d.ts +1 -1
- package/dist/api/index.d.ts +2 -1
- package/dist/api/index.js +2 -1
- package/dist/api/rag.d.ts +1 -1
- package/dist/api/rag.js +1 -1
- package/dist/api/registry.d.ts +16 -6
- package/dist/api/registry.js +32 -9
- package/dist/api/text-to-speech.d.ts +14 -5
- package/dist/api/text-to-speech.js +83 -29
- package/dist/api/transcribe.d.ts +6 -2
- package/dist/api/transcribe.js +7 -1
- package/dist/api/vector-index.d.ts +25 -3
- package/dist/api/vector-index.js +17 -2
- package/dist/api/video-request.d.ts +15 -15
- package/dist/dispatch.d.ts +10 -4
- package/dist/dispatch.js +65 -15
- package/dist/engine.d.ts +1 -1
- package/dist/errors/index.d.ts +70 -0
- package/dist/errors/index.js +128 -0
- package/dist/handlers/assess-model-fit.d.ts +3 -21
- package/dist/handlers/assess-model-fit.js +4 -303
- package/dist/handlers/cancelHandler.d.ts +10 -9
- package/dist/handlers/cancelHandler.js +17 -13
- package/dist/handlers/completion-orchestrate.d.ts +14 -2
- package/dist/handlers/completion-orchestrate.js +164 -22
- package/dist/handlers/delete-cache.d.ts +2 -1
- package/dist/handlers/delete-cache.js +6 -1
- package/dist/handlers/download-asset.js +11 -4
- package/dist/handlers/get-loaded-model-info.js +1 -0
- package/dist/handlers/get-model-info.js +71 -2
- package/dist/handlers/load-model/coreml-sidecars.d.ts +2 -13
- package/dist/handlers/load-model/coreml-sidecars.js +16 -119
- package/dist/handlers/load-model/download-lock.d.ts +20 -0
- package/dist/handlers/load-model/download-lock.js +213 -0
- package/dist/handlers/load-model/download-manager.d.ts +10 -2
- package/dist/handlers/load-model/download-manager.js +62 -11
- package/dist/handlers/load-model/handler.js +88 -35
- package/dist/handlers/load-model/http.js +327 -205
- package/dist/handlers/load-model/hyperdrive.d.ts +15 -0
- package/dist/handlers/load-model/hyperdrive.js +123 -50
- package/dist/handlers/load-model/registry-client-options.d.ts +2 -0
- package/dist/handlers/load-model/registry-client-options.js +4 -2
- package/dist/handlers/load-model/registry-companion-set.d.ts +5 -0
- package/dist/handlers/load-model/registry-companion-set.js +19 -1
- package/dist/handlers/load-model/registry-delete.d.ts +5 -0
- package/dist/handlers/load-model/registry-delete.js +269 -0
- package/dist/handlers/load-model/registry-download-utils.d.ts +4 -2
- package/dist/handlers/load-model/registry-download-utils.js +93 -22
- package/dist/handlers/load-model/registry.d.ts +20 -0
- package/dist/handlers/load-model/registry.js +308 -175
- package/dist/handlers/load-model/resolve.js +4 -1
- package/dist/handlers/load-model/types.d.ts +2 -0
- package/dist/handlers/logging-stream.js +17 -5
- package/dist/handlers/plugin-invoke.js +152 -39
- package/dist/handlers/registry.d.ts +2 -2
- package/dist/handlers/registry.js +105 -28
- package/dist/handlers/rpc-server.js +7 -7
- package/dist/handlers/session.d.ts +11 -0
- package/dist/handlers/session.js +40 -0
- package/dist/handlers/unload-model.js +8 -3
- package/dist/handlers/vector-index.js +118 -19
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/logging/utils.js +10 -2
- package/dist/model-cache-layout.d.ts +1 -0
- package/dist/model-cache-layout.js +2 -0
- package/dist/model-fit/assess.d.ts +18 -67
- package/dist/model-fit/assess.js +96 -665
- package/dist/model-fit/describe.d.ts +12 -0
- package/dist/model-fit/describe.js +29 -0
- package/dist/model-fit/description/fetch.d.ts +1 -1
- package/dist/model-fit/description/fetch.js +95 -16
- package/dist/model-fit/description/resolve-load.d.ts +5 -3
- package/dist/model-fit/description/resolve-load.js +14 -14
- package/dist/model-fit/fit-load.d.ts +23 -0
- package/dist/model-fit/fit-load.js +29 -0
- package/dist/model-fit/load-check.d.ts +15 -33
- package/dist/model-fit/load-check.js +50 -195
- package/dist/model-fit/run/engine.d.ts +12 -72
- package/dist/model-fit/run/engine.js +4 -8
- package/dist/model-fit/run/run.d.ts +10 -7
- package/dist/model-fit/run/run.js +22 -18
- package/dist/model-fit/sum.d.ts +32 -0
- package/dist/model-fit/sum.js +60 -0
- package/dist/models/registry/models.d.ts +865 -128
- package/dist/models/registry/models.js +3737 -2963
- package/dist/plugins/builtin/asr-ggml/config.d.ts +19 -4
- package/dist/plugins/builtin/asr-ggml/config.js +39 -3
- package/dist/plugins/builtin/asr-ggml/fit.d.ts +18 -0
- package/dist/{model-fit/request/engines/asr.js → plugins/builtin/asr-ggml/fit.js} +55 -71
- package/dist/plugins/builtin/audiogen-ggml/config.d.ts +6 -0
- package/dist/plugins/builtin/audiogen-ggml/config.js +9 -0
- package/dist/plugins/builtin/audiogen-ggml/fit.d.ts +3 -0
- package/dist/{model-fit/request/engines/audiogen.js → plugins/builtin/audiogen-ggml/fit.js} +28 -18
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-edit-stream.d.ts +3 -1
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-edit-stream.js +2 -1
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-encode.d.ts +17 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-encode.js +68 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-run.d.ts +11 -3
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-run.js +47 -11
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.d.ts +3 -1
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.js +2 -1
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-understand.d.ts +3 -1
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-understand.js +2 -1
- package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +143 -18
- package/dist/plugins/builtin/audiogen-ggml/plugin.js +13 -1
- package/dist/plugins/builtin/bci-whispercpp-transcription/fit.d.ts +3 -0
- package/dist/plugins/builtin/bci-whispercpp-transcription/fit.js +22 -0
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.d.ts +45 -4
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.js +8 -6
- package/dist/plugins/builtin/ggml-classification/plugin.d.ts +4 -1
- package/dist/plugins/builtin/ggml-classification/plugin.js +88 -8
- package/dist/plugins/builtin/ggml-image-embedding/ops/embed.d.ts +24 -0
- package/dist/plugins/builtin/ggml-image-embedding/ops/embed.js +184 -0
- package/dist/plugins/builtin/ggml-image-embedding/plugin.d.ts +120 -0
- package/dist/plugins/builtin/ggml-image-embedding/plugin.js +39 -0
- package/dist/plugins/builtin/ggml-ocr/fit.d.ts +6 -0
- package/dist/plugins/builtin/ggml-ocr/fit.js +19 -0
- package/dist/plugins/builtin/ggml-ocr/params.d.ts +1 -1
- package/dist/plugins/builtin/ggml-ocr/plugin.d.ts +9 -3
- package/dist/plugins/builtin/ggml-ocr/plugin.js +107 -21
- package/dist/plugins/builtin/ggml-vla/ops/vla-run.d.ts +2 -2
- package/dist/plugins/builtin/ggml-vla/ops/vla-run.js +18 -2
- package/dist/plugins/builtin/ggml-vla/plugin.d.ts +3 -3
- package/dist/plugins/builtin/index.d.ts +1 -0
- package/dist/plugins/builtin/index.js +1 -0
- package/dist/plugins/builtin/llamacpp-completion/fit.d.ts +3 -0
- package/dist/plugins/builtin/llamacpp-completion/fit.js +28 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/batch-completion-stream.js +1 -1
- package/dist/plugins/builtin/llamacpp-completion/ops/cache-logger.js +15 -4
- package/dist/plugins/builtin/llamacpp-completion/ops/calc-tokens.d.ts +2 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/calc-tokens.js +32 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.d.ts +1 -1
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.d.ts +17 -3
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +61 -5
- package/dist/plugins/builtin/llamacpp-completion/ops/finetune.d.ts +5 -4
- package/dist/plugins/builtin/llamacpp-completion/ops/finetune.js +54 -19
- package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +148 -19
- package/dist/plugins/builtin/llamacpp-completion/plugin.js +26 -9
- package/dist/plugins/builtin/llamacpp-decision/ops/decide.d.ts +3 -1
- package/dist/plugins/builtin/llamacpp-decision/ops/decide.js +5 -2
- package/dist/plugins/builtin/llamacpp-decision/plugin.d.ts +4 -2
- package/dist/plugins/builtin/llamacpp-decision/plugin.js +2 -2
- package/dist/plugins/builtin/llamacpp-embedding/fit.d.ts +3 -0
- package/dist/plugins/builtin/llamacpp-embedding/fit.js +23 -0
- package/dist/plugins/builtin/llamacpp-embedding/plugin.d.ts +194 -4
- package/dist/plugins/builtin/llamacpp-embedding/plugin.js +37 -11
- package/dist/plugins/builtin/llamacpp-embedding/transform.d.ts +2 -2
- package/dist/plugins/builtin/llamacpp-embedding/transform.js +23 -2
- package/dist/plugins/builtin/llamacpp-rerank/ops/rerank.d.ts +3 -1
- package/dist/plugins/builtin/llamacpp-rerank/ops/rerank.js +5 -2
- package/dist/plugins/builtin/llamacpp-rerank/plugin.d.ts +6 -5
- package/dist/plugins/builtin/llamacpp-rerank/plugin.js +2 -3
- package/dist/plugins/builtin/moss-transcribe/plugin.d.ts +30 -3
- package/dist/plugins/builtin/moss-transcribe/plugin.js +5 -3
- package/dist/plugins/builtin/nmtcpp-translation/fit.d.ts +3 -0
- package/dist/plugins/builtin/nmtcpp-translation/fit.js +11 -0
- package/dist/plugins/builtin/nmtcpp-translation/plugin.d.ts +14 -5
- package/dist/plugins/builtin/nmtcpp-translation/plugin.js +4 -2
- package/dist/plugins/builtin/parakeet-transcription/plugin.d.ts +205 -9
- package/dist/plugins/builtin/parakeet-transcription/plugin.js +39 -13
- package/dist/plugins/builtin/sdcpp-generation/fit.d.ts +3 -0
- package/dist/plugins/builtin/sdcpp-generation/fit.js +68 -0
- package/dist/plugins/builtin/sdcpp-generation/load-files.d.ts +30 -0
- package/dist/plugins/builtin/sdcpp-generation/load-files.js +121 -0
- package/dist/plugins/builtin/sdcpp-generation/ops/diffusion.d.ts +4 -1
- package/dist/plugins/builtin/sdcpp-generation/ops/diffusion.js +8 -3
- package/dist/plugins/builtin/sdcpp-generation/ops/upscale.d.ts +4 -1
- package/dist/plugins/builtin/sdcpp-generation/ops/upscale.js +107 -22
- package/dist/plugins/builtin/sdcpp-generation/ops/video.d.ts +3 -1
- package/dist/plugins/builtin/sdcpp-generation/ops/video.js +4 -1
- package/dist/plugins/builtin/sdcpp-generation/ops/world.d.ts +4 -2
- package/dist/plugins/builtin/sdcpp-generation/ops/world.js +7 -2
- package/dist/plugins/builtin/sdcpp-generation/plugin.d.ts +79 -16
- package/dist/plugins/builtin/sdcpp-generation/plugin.js +29 -117
- package/dist/plugins/builtin/tts-ggml/fit.d.ts +3 -0
- package/dist/plugins/builtin/tts-ggml/fit.js +162 -0
- package/dist/plugins/builtin/tts-ggml/ops/cancel-binding.d.ts +2 -1
- package/dist/plugins/builtin/tts-ggml/ops/cancel-binding.js +4 -1
- package/dist/plugins/builtin/tts-ggml/ops/moss-options.d.ts +1 -1
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.d.ts +2 -1
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.js +22 -9
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.d.ts +2 -1
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.js +51 -16
- package/dist/plugins/builtin/tts-ggml/ops/voice-options.d.ts +50 -0
- package/dist/plugins/builtin/tts-ggml/ops/voice-options.js +74 -0
- package/dist/plugins/builtin/tts-ggml/plugin.d.ts +368 -25
- package/dist/plugins/builtin/tts-ggml/plugin.js +180 -31
- package/dist/plugins/builtin/whispercpp-transcription/plugin.d.ts +70 -7
- package/dist/plugins/builtin/whispercpp-transcription/plugin.js +8 -6
- package/dist/plugins/ops/bci-transcribe.d.ts +5 -4
- package/dist/plugins/ops/bci-transcribe.js +18 -4
- package/dist/plugins/ops/cancel.d.ts +1 -0
- package/dist/plugins/ops/cancel.js +11 -2
- package/dist/plugins/ops/embed.d.ts +5 -3
- package/dist/plugins/ops/embed.js +89 -34
- package/dist/plugins/ops/kv-cache-utils.d.ts +1 -0
- package/dist/plugins/ops/kv-cache-utils.js +6 -2
- package/dist/plugins/ops/load-model.d.ts +2 -0
- package/dist/plugins/ops/load-model.js +33 -16
- package/dist/plugins/ops/transcribe.d.ts +5 -4
- package/dist/plugins/ops/transcribe.js +62 -27
- package/dist/plugins/ops/translate.d.ts +2 -1
- package/dist/plugins/ops/translate.js +4 -1
- package/dist/plugins/ops/unload-model.d.ts +17 -1
- package/dist/plugins/ops/unload-model.js +31 -2
- package/dist/plugins/turbovec-backend.d.ts +1 -1
- package/dist/plugins/turbovec-backend.js +16 -1
- package/dist/profiling/operation-metrics.js +22 -19
- package/dist/rag/embedding-scope.d.ts +16 -0
- package/dist/rag/embedding-scope.js +81 -0
- package/dist/rag/handler.d.ts +25 -0
- package/dist/rag/handler.js +50 -16
- package/dist/rag/handlers/ingest.js +2 -6
- package/dist/rag/handlers/search.d.ts +10 -1
- package/dist/rag/handlers/search.js +16 -7
- package/dist/rag/rag-operation-manager.d.ts +27 -3
- package/dist/rag/rag-operation-manager.js +10 -27
- package/dist/registry.js +5 -0
- package/dist/resources/collector.d.ts +70 -36
- package/dist/resources/collector.js +8 -1
- package/dist/resources/types.d.ts +2 -0
- package/dist/rpc/inventory.js +1 -12
- package/dist/runtime/env.d.ts +5 -1
- package/dist/runtime/env.js +6 -21
- package/dist/runtime/index.d.ts +4 -1
- package/dist/runtime/index.js +2 -0
- package/dist/runtime/lifecycle.d.ts +6 -4
- package/dist/runtime/lifecycle.js +9 -5
- package/dist/runtime/model-config-utils.js +5 -1
- package/dist/runtime/model-registry.d.ts +28 -4
- package/dist/runtime/model-registry.js +46 -1
- package/dist/runtime/model-work-lock.d.ts +13 -0
- package/dist/runtime/model-work-lock.js +48 -0
- package/dist/runtime/registry-client.d.ts +47 -1
- package/dist/runtime/registry-client.js +446 -88
- package/dist/runtime/request-context.d.ts +9 -1
- package/dist/runtime/request-context.js +25 -1
- package/dist/runtime/request-registry.d.ts +55 -7
- package/dist/runtime/request-registry.js +189 -71
- package/dist/runtime/runtime-lifecycle.js +10 -1
- package/dist/runtime/session-id.d.ts +18 -0
- package/dist/runtime/session-id.js +20 -0
- package/dist/runtime/session-registry.d.ts +39 -0
- package/dist/runtime/session-registry.js +114 -0
- package/dist/runtime/vector-index-backend.d.ts +4 -0
- package/dist/runtime/vector-index-registry.d.ts +21 -0
- package/dist/runtime/vector-index-registry.js +56 -18
- package/dist/schemas/abort-signal.d.ts +8 -0
- package/dist/schemas/abort-signal.js +1 -0
- package/dist/schemas/assess-model-fit.d.ts +132 -282
- package/dist/schemas/assess-model-fit.js +82 -216
- package/dist/schemas/audio-gen.d.ts +278 -24
- package/dist/schemas/audio-gen.js +127 -23
- package/dist/schemas/batch-completion-stream.d.ts +105 -13
- package/dist/schemas/batch-completion-stream.js +8 -4
- package/dist/schemas/bci-config.d.ts +2 -1
- package/dist/schemas/bci.d.ts +54 -3
- package/dist/schemas/bci.js +11 -16
- package/dist/schemas/calc-tokens.d.ts +141 -0
- package/dist/schemas/calc-tokens.js +53 -0
- package/dist/schemas/cancel.d.ts +26 -0
- package/dist/schemas/cancel.js +10 -2
- package/dist/schemas/classification.d.ts +3 -0
- package/dist/schemas/classification.js +6 -2
- package/dist/schemas/common.d.ts +1831 -348
- package/dist/schemas/common.js +18 -2
- package/dist/schemas/completion-event.d.ts +3 -0
- package/dist/schemas/completion-event.js +1 -1
- package/dist/schemas/completion-stream.d.ts +162 -17
- package/dist/schemas/completion-stream.js +83 -13
- package/dist/schemas/config.d.ts +1212 -169
- package/dist/schemas/config.js +9 -13
- package/dist/schemas/decision.d.ts +4 -2
- package/dist/schemas/decision.js +2 -1
- package/dist/schemas/download-asset.d.ts +10 -5
- package/dist/schemas/download-asset.js +3 -6
- package/dist/schemas/embed.d.ts +286 -3
- package/dist/schemas/embed.js +162 -16
- package/dist/schemas/engine-addon-map.d.ts +1 -0
- package/dist/schemas/engine-addon-map.js +1 -0
- package/dist/schemas/errors.d.ts +12 -0
- package/dist/schemas/errors.js +66 -1
- package/dist/schemas/finetune.d.ts +14 -4
- package/dist/schemas/finetune.js +5 -6
- package/dist/schemas/heartbeat.d.ts +1 -0
- package/dist/schemas/heartbeat.js +5 -2
- package/dist/schemas/image-embedding.d.ts +27 -0
- package/dist/schemas/image-embedding.js +107 -0
- package/dist/schemas/index.d.ts +7 -3
- package/dist/schemas/index.js +7 -3
- package/dist/schemas/lifecycle.d.ts +3 -0
- package/dist/schemas/lifecycle.js +13 -6
- package/dist/schemas/llamacpp-config.d.ts +269 -22
- package/dist/schemas/llamacpp-config.js +86 -7
- package/dist/schemas/load-model.d.ts +6418 -1960
- package/dist/schemas/load-model.js +39 -8
- package/dist/schemas/logging-stream.d.ts +1 -0
- package/dist/schemas/logging-stream.js +5 -2
- package/dist/schemas/model-config-schemas.d.ts +542 -116
- package/dist/schemas/model-config-schemas.js +2 -0
- package/dist/schemas/model-fit-policy.d.ts +2 -2
- package/dist/schemas/model-info.d.ts +54 -56
- package/dist/schemas/model-info.js +17 -6
- package/dist/schemas/model-ops.d.ts +12 -0
- package/dist/schemas/model-ops.js +33 -5
- package/dist/schemas/model-src-utils.d.ts +10 -6
- package/dist/schemas/model-types.d.ts +8 -4
- package/dist/schemas/model-types.js +1 -0
- package/dist/schemas/ocr.d.ts +9 -4
- package/dist/schemas/ocr.js +6 -2
- package/dist/schemas/plugin.d.ts +62 -6
- package/dist/schemas/plugin.js +26 -4
- package/dist/schemas/profiling.d.ts +32 -32
- package/dist/schemas/rag.d.ts +9 -0
- package/dist/schemas/rag.js +10 -16
- package/dist/schemas/registry.d.ts +30 -10
- package/dist/schemas/registry.js +14 -6
- package/dist/schemas/reload-config.d.ts +41 -6
- package/dist/schemas/reload-config.js +11 -4
- package/dist/schemas/request-base.d.ts +39 -0
- package/dist/schemas/request-base.js +64 -0
- package/dist/schemas/rerank.d.ts +8 -7
- package/dist/schemas/rerank.js +6 -4
- package/dist/schemas/rpc-server.d.ts +3 -0
- package/dist/schemas/rpc-server.js +15 -15
- package/dist/schemas/sdcpp-config.d.ts +90 -20
- package/dist/schemas/sdcpp-config.js +96 -19
- package/dist/schemas/session.d.ts +37 -0
- package/dist/schemas/session.js +53 -0
- package/dist/schemas/system-resources.d.ts +364 -179
- package/dist/schemas/system-resources.js +8 -3
- package/dist/schemas/text-to-speech.d.ts +1343 -271
- package/dist/schemas/text-to-speech.js +547 -33
- package/dist/schemas/tools.d.ts +7 -0
- package/dist/schemas/tools.js +29 -0
- package/dist/schemas/transcription-config.d.ts +262 -2
- package/dist/schemas/transcription-config.js +122 -6
- package/dist/schemas/transcription.d.ts +93 -6
- package/dist/schemas/transcription.js +98 -21
- package/dist/schemas/translate.d.ts +2 -0
- package/dist/schemas/translate.js +5 -9
- package/dist/schemas/translation-config.d.ts +30 -20
- package/dist/schemas/tts-pcm.d.ts +35 -0
- package/dist/schemas/tts-pcm.js +69 -0
- package/dist/schemas/vector-index.d.ts +47 -1
- package/dist/schemas/vector-index.js +37 -10
- package/dist/schemas/vla.d.ts +3 -3
- package/dist/surface.d.ts +3 -3
- package/dist/surface.js +3 -3
- package/dist/utils/addon-responses.d.ts +69 -2
- package/dist/utils/archive.d.ts +7 -0
- package/dist/utils/archive.js +88 -29
- package/dist/utils/asr-events.d.ts +5 -0
- package/dist/utils/asr-events.js +10 -1
- package/dist/utils/cache/auto-history.js +3 -1
- package/dist/utils/cache/layout.d.ts +48 -0
- package/dist/utils/cache/layout.js +190 -0
- package/dist/utils/cache/paths.js +2 -4
- package/dist/utils/cache/types.d.ts +2 -1
- package/dist/utils/checksum.d.ts +5 -0
- package/dist/utils/checksum.js +18 -0
- package/dist/utils/completion-normalizer.js +286 -87
- package/dist/utils/gguf-tensor-extractor.d.ts +0 -6
- package/dist/utils/gguf-tensor-extractor.js +1 -50
- package/dist/utils/shard-utils.d.ts +0 -21
- package/dist/utils/shard-utils.js +12 -62
- package/dist/utils/tool-integration.d.ts +2 -2
- package/dist/utils/tools/defer.d.ts +39 -10
- package/dist/utils/tools/defer.js +72 -17
- package/dist/utils/tools/index.d.ts +1 -1
- package/dist/utils/tools/index.js +1 -1
- package/dist/utils/transcribe-metadata.d.ts +28 -2
- package/dist/utils/transcribe-metadata.js +16 -0
- package/dist/utils/tts-stats.d.ts +42 -0
- package/dist/utils/tts-stats.js +120 -22
- package/package.json +43 -39
- package/dist/model-fit/classify.d.ts +0 -6
- package/dist/model-fit/classify.js +0 -166
- package/dist/model-fit/description/project.d.ts +0 -27
- package/dist/model-fit/description/project.js +0 -33
- package/dist/model-fit/floor.d.ts +0 -31
- package/dist/model-fit/floor.js +0 -65
- package/dist/model-fit/kv-cache.d.ts +0 -23
- package/dist/model-fit/kv-cache.js +0 -85
- package/dist/model-fit/platform.d.ts +0 -14
- package/dist/model-fit/platform.js +0 -26
- package/dist/model-fit/request/create.d.ts +0 -31
- package/dist/model-fit/request/create.js +0 -61
- package/dist/model-fit/request/engines/asr.d.ts +0 -14
- package/dist/model-fit/request/engines/audiogen.d.ts +0 -8
- package/dist/model-fit/request/engines/diffusion.d.ts +0 -7
- package/dist/model-fit/request/engines/diffusion.js +0 -93
- package/dist/model-fit/request/engines/llama.d.ts +0 -12
- package/dist/model-fit/request/engines/llama.js +0 -44
- package/dist/model-fit/request/engines/nmt.d.ts +0 -8
- package/dist/model-fit/request/engines/nmt.js +0 -11
- package/dist/model-fit/request/engines/ocr.d.ts +0 -9
- package/dist/model-fit/request/engines/ocr.js +0 -13
- package/dist/model-fit/request/engines/tts.d.ts +0 -10
- package/dist/model-fit/request/engines/tts.js +0 -152
- package/dist/models/registry/resource-profiles.d.ts +0 -17
- package/dist/models/registry/resource-profiles.js +0 -5859
- package/dist/schemas/model-resource-profile.d.ts +0 -109
- package/dist/schemas/model-resource-profile.js +0 -80
- /package/dist/model-fit/{request/gpu.d.ts → gpu.d.ts} +0 -0
- /package/dist/model-fit/{request/gpu.js → gpu.js} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { assessFit as bciAssessFit } from '@qvac/bci-whispercpp';
|
|
2
2
|
import { type CreateModelParams, type PluginModelResult } from '../../../schemas/index.js';
|
|
3
3
|
import { resolveBciConfig } from '../../../plugins/builtin/bci-whispercpp-transcription/resolve-config.js';
|
|
4
|
+
import { bciFitRequest } from '../../../plugins/builtin/bci-whispercpp-transcription/fit.js';
|
|
4
5
|
export declare const bciPlugin: {
|
|
5
6
|
modelType: "bci-whispercpp-transcription";
|
|
6
7
|
displayName: string;
|
|
@@ -54,6 +55,7 @@ export declare const bciPlugin: {
|
|
|
54
55
|
audiogen: "audiogen";
|
|
55
56
|
tts: "tts";
|
|
56
57
|
ocr: "ocr";
|
|
58
|
+
classification: "classification";
|
|
57
59
|
vla: "vla";
|
|
58
60
|
"llamacpp-completion": "llamacpp-completion";
|
|
59
61
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
@@ -70,16 +72,17 @@ export declare const bciPlugin: {
|
|
|
70
72
|
"sdcpp-generation": "sdcpp-generation";
|
|
71
73
|
"audiogen-ggml": "audiogen-ggml";
|
|
72
74
|
"ggml-vla": "ggml-vla";
|
|
75
|
+
"ggml-image-embedding": "ggml-image-embedding";
|
|
73
76
|
"ggml-classification": "ggml-classification";
|
|
74
77
|
llm: "llm";
|
|
75
78
|
whisper: "whisper";
|
|
76
79
|
bci: "bci";
|
|
77
80
|
nmt: "nmt";
|
|
78
81
|
parakeet: "parakeet";
|
|
79
|
-
classification: "classification";
|
|
80
82
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
81
83
|
}, import("zod/v4/core").$strip>]>>;
|
|
82
84
|
}, import("zod/v4/core").$strip>;
|
|
85
|
+
fitRequest: typeof bciFitRequest;
|
|
83
86
|
assessFit: typeof bciAssessFit;
|
|
84
87
|
resolveConfig: typeof resolveBciConfig;
|
|
85
88
|
createModel(params: CreateModelParams): PluginModelResult;
|
|
@@ -95,6 +98,7 @@ export declare const bciPlugin: {
|
|
|
95
98
|
value: import("zod").ZodString;
|
|
96
99
|
}, import("zod/v4/core").$strip>], "type">;
|
|
97
100
|
type: import("zod").ZodLiteral<"bciTranscribe">;
|
|
101
|
+
sessionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
98
102
|
requestId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
99
103
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
100
104
|
text: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -127,6 +131,11 @@ export declare const bciPlugin: {
|
|
|
127
131
|
totalEncodedFrames: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
128
132
|
encoderOnCoreml: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
129
133
|
encoderUsedCoreml: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
134
|
+
aoscActive: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
135
|
+
prefillTime: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
136
|
+
audioTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
137
|
+
promptTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
138
|
+
generatedTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
130
139
|
}, import("zod/v4/core").$strip>>;
|
|
131
140
|
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
132
141
|
segment: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
@@ -144,6 +153,19 @@ export declare const bciPlugin: {
|
|
|
144
153
|
}, import("zod/v4/core").$strip>>>;
|
|
145
154
|
isEndOfTurn: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
146
155
|
startsWord: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
156
|
+
language: import("zod").ZodOptional<import("zod").ZodString>;
|
|
157
|
+
noSpeechProb: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
158
|
+
speakerTurnNext: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
159
|
+
tokens: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
160
|
+
text: import("zod").ZodString;
|
|
161
|
+
startMs: import("zod").ZodNumber;
|
|
162
|
+
endMs: import("zod").ZodNumber;
|
|
163
|
+
probability: import("zod").ZodNumber;
|
|
164
|
+
}, import("zod/v4/core").$strip>>>;
|
|
165
|
+
tokenIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodNumber>>;
|
|
166
|
+
isFinal: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
167
|
+
chunkIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
168
|
+
eotConfidence: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
147
169
|
}, import("zod/v4/core").$strip>>;
|
|
148
170
|
type: import("zod").ZodLiteral<"bciTranscribe">;
|
|
149
171
|
diagnostics: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
@@ -153,16 +175,16 @@ export declare const bciPlugin: {
|
|
|
153
175
|
gpu: "gpu";
|
|
154
176
|
}>;
|
|
155
177
|
graphicsApi: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
156
|
-
cuda: "cuda";
|
|
157
178
|
vulkan: "vulkan";
|
|
158
|
-
metal: "metal";
|
|
159
179
|
opencl: "opencl";
|
|
160
|
-
rocm: "rocm";
|
|
161
180
|
opengl: "opengl";
|
|
162
181
|
webgpu: "webgpu";
|
|
182
|
+
metal: "metal";
|
|
163
183
|
direct3d11: "direct3d11";
|
|
164
184
|
direct3d12: "direct3d12";
|
|
185
|
+
cuda: "cuda";
|
|
165
186
|
levelZero: "levelZero";
|
|
187
|
+
rocm: "rocm";
|
|
166
188
|
}>>;
|
|
167
189
|
driver: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
168
190
|
name: import("zod").ZodString;
|
|
@@ -200,6 +222,7 @@ export declare const bciPlugin: {
|
|
|
200
222
|
delta: "delta";
|
|
201
223
|
}>>;
|
|
202
224
|
}, import("zod/v4/core").$strip>>;
|
|
225
|
+
sessionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
203
226
|
requestId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
204
227
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
205
228
|
text: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -232,6 +255,11 @@ export declare const bciPlugin: {
|
|
|
232
255
|
totalEncodedFrames: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
233
256
|
encoderOnCoreml: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
234
257
|
encoderUsedCoreml: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
258
|
+
aoscActive: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
259
|
+
prefillTime: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
260
|
+
audioTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
261
|
+
promptTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
262
|
+
generatedTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
235
263
|
}, import("zod/v4/core").$strip>>;
|
|
236
264
|
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
237
265
|
type: import("zod").ZodLiteral<"bciTranscribeStream">;
|
|
@@ -250,6 +278,19 @@ export declare const bciPlugin: {
|
|
|
250
278
|
}, import("zod/v4/core").$strip>>>;
|
|
251
279
|
isEndOfTurn: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
252
280
|
startsWord: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
281
|
+
language: import("zod").ZodOptional<import("zod").ZodString>;
|
|
282
|
+
noSpeechProb: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
283
|
+
speakerTurnNext: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
284
|
+
tokens: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
285
|
+
text: import("zod").ZodString;
|
|
286
|
+
startMs: import("zod").ZodNumber;
|
|
287
|
+
endMs: import("zod").ZodNumber;
|
|
288
|
+
probability: import("zod").ZodNumber;
|
|
289
|
+
}, import("zod/v4/core").$strip>>>;
|
|
290
|
+
tokenIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodNumber>>;
|
|
291
|
+
isFinal: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
292
|
+
chunkIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
293
|
+
eotConfidence: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
253
294
|
windowStartTimestep: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
254
295
|
}, import("zod/v4/core").$strip>>;
|
|
255
296
|
}, import("zod/v4/core").$strip>>;
|
|
@@ -6,6 +6,7 @@ import { attachModelExecutionMs } from '../../../profiling/model-execution.js';
|
|
|
6
6
|
import { attachBackendDiagnostics } from '../../../profiling/backend-diagnostics.js';
|
|
7
7
|
import { buildBciWhispercppArgs } from '../../../plugins/builtin/bci-whispercpp-transcription/args.js';
|
|
8
8
|
import { resolveBciConfig } from '../../../plugins/builtin/bci-whispercpp-transcription/resolve-config.js';
|
|
9
|
+
import { bciFitRequest } from '../../../plugins/builtin/bci-whispercpp-transcription/fit.js';
|
|
9
10
|
function createBciModel(modelId, modelPath, bciConfig, embedderPath) {
|
|
10
11
|
const logger = createStreamLogger(modelId, ModelType.bciWhispercppTranscription);
|
|
11
12
|
registerAddonLogger(modelId, ModelType.bciWhispercppTranscription, logger);
|
|
@@ -18,6 +19,7 @@ export const bciPlugin = definePlugin({
|
|
|
18
19
|
displayName: 'BCI (whisper.cpp)',
|
|
19
20
|
addonPackage: ADDON_BCI,
|
|
20
21
|
loadConfigSchema: bciConfigSchema,
|
|
22
|
+
fitRequest: bciFitRequest,
|
|
21
23
|
assessFit: bciAssessFit,
|
|
22
24
|
resolveConfig: resolveBciConfig,
|
|
23
25
|
createModel(params) {
|
|
@@ -33,18 +35,18 @@ export const bciPlugin = definePlugin({
|
|
|
33
35
|
// The BCI addon exposes a model-wide hard cancel — the running
|
|
34
36
|
// neural-signal job is interrupted on `cancel()`.
|
|
35
37
|
cancel: { scope: 'model', hard: true },
|
|
36
|
-
handler: async function* (request) {
|
|
38
|
+
handler: async function* (request, _inputStream, context) {
|
|
37
39
|
const metadata = request.metadata === true;
|
|
38
40
|
const stream = metadata
|
|
39
41
|
? bciTranscribe({
|
|
40
42
|
modelId: request.modelId,
|
|
41
43
|
neuralData: request.neuralData,
|
|
42
44
|
metadata: true
|
|
43
|
-
}, request.requestId)
|
|
45
|
+
}, request.requestId, request.sessionId, context)
|
|
44
46
|
: bciTranscribe({
|
|
45
47
|
modelId: request.modelId,
|
|
46
48
|
neuralData: request.neuralData
|
|
47
|
-
}, request.requestId);
|
|
49
|
+
}, request.requestId, request.sessionId, context);
|
|
48
50
|
try {
|
|
49
51
|
let result = await stream.next();
|
|
50
52
|
while (!result.done) {
|
|
@@ -85,11 +87,11 @@ export const bciPlugin = definePlugin({
|
|
|
85
87
|
// addon's `cancel()` tears down the active stream and interrupts the
|
|
86
88
|
// running window job.
|
|
87
89
|
cancel: { scope: 'model', hard: true },
|
|
88
|
-
handler: async function* (request, inputStream) {
|
|
90
|
+
handler: async function* (request, inputStream, context) {
|
|
89
91
|
const metadata = request.metadata === true;
|
|
90
92
|
const iterator = metadata
|
|
91
|
-
? bciTranscribeStream(request.modelId, inputStream, true, request.streamOpts, request.requestId)
|
|
92
|
-
: bciTranscribeStream(request.modelId, inputStream, false, request.streamOpts, request.requestId);
|
|
93
|
+
? bciTranscribeStream(request.modelId, inputStream, true, request.streamOpts, request.requestId, request.sessionId, context)
|
|
94
|
+
: bciTranscribeStream(request.modelId, inputStream, false, request.streamOpts, request.requestId, request.sessionId, context);
|
|
93
95
|
// Iterated by hand rather than with `for await` so the generator's
|
|
94
96
|
// return value survives: it carries the execution time the profiling
|
|
95
97
|
// layer reads off the terminal frame.
|
|
@@ -11,7 +11,7 @@ export declare const classificationPlugin: {
|
|
|
11
11
|
skipPrimaryModelPathValidation: true;
|
|
12
12
|
createModel(params: CreateModelParams): PluginModelResult;
|
|
13
13
|
handlers: {
|
|
14
|
-
classify: import("../../../schemas/
|
|
14
|
+
classify: import("../../../schemas/plugin.js").PluginHandlerDefinition<import("zod").ZodObject<{
|
|
15
15
|
modelId: import("zod").ZodString;
|
|
16
16
|
image: import("zod").ZodString;
|
|
17
17
|
topK: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
@@ -19,8 +19,11 @@ export declare const classificationPlugin: {
|
|
|
19
19
|
height: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
20
20
|
channels: import("zod").ZodOptional<import("zod").ZodLiteral<3>>;
|
|
21
21
|
type: import("zod").ZodLiteral<"classify">;
|
|
22
|
+
sessionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
23
|
+
requestId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
22
24
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
23
25
|
type: import("zod").ZodLiteral<"classify">;
|
|
26
|
+
requestId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
24
27
|
results: import("zod").ZodArray<import("zod").ZodObject<{
|
|
25
28
|
label: import("zod").ZodString;
|
|
26
29
|
confidence: import("zod").ZodNumber;
|
|
@@ -1,7 +1,63 @@
|
|
|
1
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
+
if (value !== null && value !== void 0) {
|
|
3
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
+
var dispose, inner;
|
|
5
|
+
if (async) {
|
|
6
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
+
dispose = value[Symbol.asyncDispose];
|
|
8
|
+
}
|
|
9
|
+
if (dispose === void 0) {
|
|
10
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
+
dispose = value[Symbol.dispose];
|
|
12
|
+
if (async) inner = dispose;
|
|
13
|
+
}
|
|
14
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
+
}
|
|
18
|
+
else if (async) {
|
|
19
|
+
env.stack.push({ async: true });
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
+
return function (env) {
|
|
25
|
+
function fail(e) {
|
|
26
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
+
env.hasError = true;
|
|
28
|
+
}
|
|
29
|
+
var r, s = 0;
|
|
30
|
+
function next() {
|
|
31
|
+
while (r = env.stack.pop()) {
|
|
32
|
+
try {
|
|
33
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
+
if (r.dispose) {
|
|
35
|
+
var result = r.dispose.call(r.value);
|
|
36
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
+
}
|
|
38
|
+
else s |= 1;
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
fail(e);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
+
if (env.hasError) throw env.error;
|
|
46
|
+
}
|
|
47
|
+
return next();
|
|
48
|
+
};
|
|
49
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
+
var e = new Error(message);
|
|
51
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
+
});
|
|
53
|
+
import { requestParent } from '../../../schemas/plugin.js';
|
|
1
54
|
import ImageClassifier from '@qvac/classification-ggml';
|
|
2
55
|
import { definePlugin, defineHandler, classifyRequestSchema, classifyResponseSchema, ModelType, classificationConfigSchema, ADDON_CLASSIFICATION } from '../../../schemas/index.js';
|
|
3
56
|
import { createStreamLogger, registerAddonLogger } from '../../../logging/index.js';
|
|
4
57
|
import { classify } from '../../../plugins/builtin/ggml-classification/ops/classify.js';
|
|
58
|
+
import { InferenceCancelledError } from '../../../errors/index.js';
|
|
59
|
+
import { getRequestRegistry } from '../../../runtime/index.js';
|
|
60
|
+
import { generateRandomRequestId } from '../../../runtime/request-id.js';
|
|
5
61
|
export const classificationPlugin = definePlugin({
|
|
6
62
|
modelType: ModelType.ggmlClassification,
|
|
7
63
|
displayName: 'Image Classification (GGML)',
|
|
@@ -41,14 +97,38 @@ export const classificationPlugin = definePlugin({
|
|
|
41
97
|
// surface — mirrors `ocr`/`tts`/`upscale`. The yield-once handler
|
|
42
98
|
// can't be interrupted partway, so we declare scope:"none".
|
|
43
99
|
cancel: { scope: 'none' },
|
|
44
|
-
handler: async function* (request) {
|
|
45
|
-
const {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
100
|
+
handler: async function* (request, _inputStream, context) {
|
|
101
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
102
|
+
try {
|
|
103
|
+
const ctx = __addDisposableResource(env_1, await getRequestRegistry().begin({
|
|
104
|
+
requestId: request.requestId ?? generateRandomRequestId(),
|
|
105
|
+
sessionId: request.sessionId,
|
|
106
|
+
...requestParent(context),
|
|
107
|
+
kind: 'classification',
|
|
108
|
+
modelId: request.modelId
|
|
109
|
+
}), true);
|
|
110
|
+
if (ctx.signal.aborted)
|
|
111
|
+
throw new InferenceCancelledError(ctx.requestId);
|
|
112
|
+
const { results, modelExecutionMs } = await classify(request);
|
|
113
|
+
if (ctx.signal.aborted)
|
|
114
|
+
throw new InferenceCancelledError(ctx.requestId);
|
|
115
|
+
yield {
|
|
116
|
+
type: 'classify',
|
|
117
|
+
requestId: ctx.requestId,
|
|
118
|
+
results,
|
|
119
|
+
done: true,
|
|
120
|
+
modelExecutionMs
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
catch (e_1) {
|
|
124
|
+
env_1.error = e_1;
|
|
125
|
+
env_1.hasError = true;
|
|
126
|
+
}
|
|
127
|
+
finally {
|
|
128
|
+
const result_1 = __disposeResources(env_1);
|
|
129
|
+
if (result_1)
|
|
130
|
+
await result_1;
|
|
131
|
+
}
|
|
52
132
|
}
|
|
53
133
|
})
|
|
54
134
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type PluginHandlerContext } from '../../../../schemas/plugin.js';
|
|
2
|
+
import { type EmbedRequest, type EmbedBatchRequest } from '../../../../schemas/index.js';
|
|
3
|
+
export declare function embed(request: EmbedRequest, context?: PluginHandlerContext): Promise<{
|
|
4
|
+
type: "embed";
|
|
5
|
+
success: boolean;
|
|
6
|
+
embedding: number[] | number[][];
|
|
7
|
+
stats: {
|
|
8
|
+
totalTime?: number | undefined;
|
|
9
|
+
backendId?: number | undefined;
|
|
10
|
+
cpuFallbackNodes?: number | undefined;
|
|
11
|
+
weightBytes?: number | undefined;
|
|
12
|
+
};
|
|
13
|
+
}>;
|
|
14
|
+
export declare function embedBatch(request: EmbedBatchRequest, context?: PluginHandlerContext): Promise<{
|
|
15
|
+
type: "embedBatch";
|
|
16
|
+
success: boolean;
|
|
17
|
+
embedding: number[][];
|
|
18
|
+
stats: {
|
|
19
|
+
totalTime?: number | undefined;
|
|
20
|
+
backendId?: number | undefined;
|
|
21
|
+
cpuFallbackNodes?: number | undefined;
|
|
22
|
+
weightBytes?: number | undefined;
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
+
if (value !== null && value !== void 0) {
|
|
3
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
+
var dispose, inner;
|
|
5
|
+
if (async) {
|
|
6
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
+
dispose = value[Symbol.asyncDispose];
|
|
8
|
+
}
|
|
9
|
+
if (dispose === void 0) {
|
|
10
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
+
dispose = value[Symbol.dispose];
|
|
12
|
+
if (async) inner = dispose;
|
|
13
|
+
}
|
|
14
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
+
}
|
|
18
|
+
else if (async) {
|
|
19
|
+
env.stack.push({ async: true });
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
+
return function (env) {
|
|
25
|
+
function fail(e) {
|
|
26
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
+
env.hasError = true;
|
|
28
|
+
}
|
|
29
|
+
var r, s = 0;
|
|
30
|
+
function next() {
|
|
31
|
+
while (r = env.stack.pop()) {
|
|
32
|
+
try {
|
|
33
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
+
if (r.dispose) {
|
|
35
|
+
var result = r.dispose.call(r.value);
|
|
36
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
+
}
|
|
38
|
+
else s |= 1;
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
fail(e);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
+
if (env.hasError) throw env.error;
|
|
46
|
+
}
|
|
47
|
+
return next();
|
|
48
|
+
};
|
|
49
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
+
var e = new Error(message);
|
|
51
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
+
});
|
|
53
|
+
import fs from 'bare-fs';
|
|
54
|
+
import { getModel } from '../../../../runtime/model-registry.js';
|
|
55
|
+
import { getRequestRegistry } from '../../../../runtime/request-context.js';
|
|
56
|
+
import { generateRandomRequestId } from '../../../../runtime/request-id.js';
|
|
57
|
+
import { EmbedFailedError, InferenceCancelledError, InvalidResponseError } from '../../../../errors/index.js';
|
|
58
|
+
import { decodeBase64 } from '../../../../utils/encoding.js';
|
|
59
|
+
import { nowMs } from '../../../../profiling/index.js';
|
|
60
|
+
import { attachModelExecutionMs, forwardModelExecution } from '../../../../profiling/model-execution.js';
|
|
61
|
+
import { requestParent } from '../../../../schemas/plugin.js';
|
|
62
|
+
import { embedRequestSchema, embedBatchRequestSchema, imageEmbeddingSchema } from '../../../../schemas/index.js';
|
|
63
|
+
export async function embed(request, context) {
|
|
64
|
+
const parsed = embedRequestSchema.parse(request);
|
|
65
|
+
const inputs = parsed.input !== undefined ? [parsed.input] : parsed.inputs;
|
|
66
|
+
if (inputs === undefined)
|
|
67
|
+
throw new EmbedFailedError('MegaLoc accepts images, not text');
|
|
68
|
+
const result = await runImages(parsed, inputs, context);
|
|
69
|
+
return forwardModelExecution({
|
|
70
|
+
type: 'embed',
|
|
71
|
+
success: true,
|
|
72
|
+
embedding: parsed.input !== undefined ? result.embedding[0] : result.embedding,
|
|
73
|
+
stats: result.stats
|
|
74
|
+
}, result);
|
|
75
|
+
}
|
|
76
|
+
export async function embedBatch(request, context) {
|
|
77
|
+
const parsed = embedBatchRequestSchema.parse(request);
|
|
78
|
+
const result = await runImages(parsed, parsed.inputs, context);
|
|
79
|
+
return forwardModelExecution({
|
|
80
|
+
type: 'embedBatch',
|
|
81
|
+
success: true,
|
|
82
|
+
embedding: result.embedding,
|
|
83
|
+
stats: result.stats
|
|
84
|
+
}, result);
|
|
85
|
+
}
|
|
86
|
+
// Runs before queue admission, so a malformed batch fails without waiting or starting native work.
|
|
87
|
+
// The request schema has already checked base64 and RGB byte lengths.
|
|
88
|
+
function toImageSource(input) {
|
|
89
|
+
if (typeof input === 'object' && !Array.isArray(input))
|
|
90
|
+
return { kind: 'image', input };
|
|
91
|
+
if (Array.isArray(input) && input.length === 1 && typeof input[0] !== 'string') {
|
|
92
|
+
return { kind: 'media', media: input[0].media };
|
|
93
|
+
}
|
|
94
|
+
throw new EmbedFailedError('MegaLoc requires one image per input and does not accept text or audio');
|
|
95
|
+
}
|
|
96
|
+
// Loads one image at a time so a batch never holds every decoded image in memory.
|
|
97
|
+
async function loadImage(source) {
|
|
98
|
+
if (source.kind === 'image') {
|
|
99
|
+
const { image, width, height, channels } = source.input;
|
|
100
|
+
const dimensions = width !== undefined && height !== undefined && channels !== undefined
|
|
101
|
+
? { width, height, channels }
|
|
102
|
+
: undefined;
|
|
103
|
+
return { image: decodeBase64(image), dimensions };
|
|
104
|
+
}
|
|
105
|
+
const { type, value } = source.media;
|
|
106
|
+
if (type === 'base64')
|
|
107
|
+
return { image: decodeBase64(value), dimensions: undefined };
|
|
108
|
+
let image;
|
|
109
|
+
try {
|
|
110
|
+
image = await fs.promises.readFile(value, 'buffer');
|
|
111
|
+
}
|
|
112
|
+
catch (cause) {
|
|
113
|
+
throw new EmbedFailedError('Unable to read embedding media', cause);
|
|
114
|
+
}
|
|
115
|
+
if (image.byteLength === 0)
|
|
116
|
+
throw new EmbedFailedError('Image cannot be empty');
|
|
117
|
+
return { image, dimensions: undefined };
|
|
118
|
+
}
|
|
119
|
+
async function runImages(request, inputs, context) {
|
|
120
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
121
|
+
try {
|
|
122
|
+
const { modelId, requestId, sessionId } = request;
|
|
123
|
+
const sources = inputs.map(toImageSource);
|
|
124
|
+
const ctx = __addDisposableResource(env_1, await getRequestRegistry().begin({
|
|
125
|
+
requestId: requestId ?? generateRandomRequestId(),
|
|
126
|
+
sessionId,
|
|
127
|
+
...requestParent(context),
|
|
128
|
+
kind: 'imageEmbedding',
|
|
129
|
+
modelId
|
|
130
|
+
}), true);
|
|
131
|
+
if (ctx.signal.aborted)
|
|
132
|
+
throw new InferenceCancelledError(ctx.requestId);
|
|
133
|
+
const model = getModel(modelId);
|
|
134
|
+
const started = nowMs();
|
|
135
|
+
try {
|
|
136
|
+
const embedding = [];
|
|
137
|
+
let totalTime;
|
|
138
|
+
let native;
|
|
139
|
+
for (const source of sources) {
|
|
140
|
+
if (ctx.signal.aborted)
|
|
141
|
+
throw new InferenceCancelledError(ctx.requestId);
|
|
142
|
+
const { image, dimensions } = await loadImage(source);
|
|
143
|
+
if (ctx.signal.aborted)
|
|
144
|
+
throw new InferenceCancelledError(ctx.requestId);
|
|
145
|
+
const raw = await model.embed(image, dimensions);
|
|
146
|
+
if (ctx.signal.aborted)
|
|
147
|
+
throw new InferenceCancelledError(ctx.requestId);
|
|
148
|
+
const parsed = imageEmbeddingSchema.safeParse(Array.from(raw));
|
|
149
|
+
if (!parsed.success)
|
|
150
|
+
throw new InvalidResponseError('embed', parsed.error);
|
|
151
|
+
embedding.push(parsed.data);
|
|
152
|
+
native = model.getRuntimeStats();
|
|
153
|
+
if (native.total_time_ms !== undefined) {
|
|
154
|
+
totalTime = (totalTime ?? 0) + native.total_time_ms;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// totalTime sums every image; the remaining fields describe the final image.
|
|
158
|
+
const stats = {
|
|
159
|
+
...(totalTime !== undefined && { totalTime }),
|
|
160
|
+
...(native?.backend_id !== undefined && { backendId: native.backend_id }),
|
|
161
|
+
...(native?.cpu_fallback_nodes !== undefined && {
|
|
162
|
+
cpuFallbackNodes: native.cpu_fallback_nodes
|
|
163
|
+
}),
|
|
164
|
+
...(native?.weight_bytes !== undefined && { weightBytes: native.weight_bytes })
|
|
165
|
+
};
|
|
166
|
+
return attachModelExecutionMs({ embedding, stats }, nowMs() - started);
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
if (ctx.signal.aborted)
|
|
170
|
+
throw new InferenceCancelledError(ctx.requestId, {}, error);
|
|
171
|
+
ctx.state = 'failed';
|
|
172
|
+
throw error;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
catch (e_1) {
|
|
176
|
+
env_1.error = e_1;
|
|
177
|
+
env_1.hasError = true;
|
|
178
|
+
}
|
|
179
|
+
finally {
|
|
180
|
+
const result_1 = __disposeResources(env_1);
|
|
181
|
+
if (result_1)
|
|
182
|
+
await result_1;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { MegaLoc } from '@qvac/classification-ggml';
|
|
2
|
+
export declare const imageEmbeddingPlugin: {
|
|
3
|
+
modelType: "ggml-image-embedding";
|
|
4
|
+
displayName: string;
|
|
5
|
+
addonPackage: "@qvac/classification-ggml";
|
|
6
|
+
loadConfigSchema: import("zod").ZodObject<{
|
|
7
|
+
backend: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
|
+
threads: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
9
|
+
backendsDir: import("zod").ZodOptional<import("zod").ZodString>;
|
|
10
|
+
}, import("zod/v4/core").$strip>;
|
|
11
|
+
createModel(params: import("../../../schemas/index.js").CreateModelParams): {
|
|
12
|
+
model: MegaLoc;
|
|
13
|
+
};
|
|
14
|
+
handlers: {
|
|
15
|
+
embed: import("../../../schemas/index.js").PluginHandlerDefinition<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
16
|
+
modelId: import("zod").ZodString;
|
|
17
|
+
text: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>;
|
|
18
|
+
inputs: import("zod").ZodOptional<import("zod").ZodNever>;
|
|
19
|
+
input: import("zod").ZodOptional<import("zod").ZodNever>;
|
|
20
|
+
type: import("zod").ZodLiteral<"embed">;
|
|
21
|
+
sessionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
22
|
+
requestId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
23
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
24
|
+
modelId: import("zod").ZodString;
|
|
25
|
+
inputs: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
26
|
+
media: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
27
|
+
type: import("zod").ZodLiteral<"base64">;
|
|
28
|
+
value: import("zod").ZodString;
|
|
29
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
30
|
+
type: import("zod").ZodLiteral<"filePath">;
|
|
31
|
+
value: import("zod").ZodString;
|
|
32
|
+
}, import("zod/v4/core").$strip>], "type">;
|
|
33
|
+
}, import("zod/v4/core").$strip>]>>]>>;
|
|
34
|
+
text: import("zod").ZodOptional<import("zod").ZodNever>;
|
|
35
|
+
input: import("zod").ZodOptional<import("zod").ZodNever>;
|
|
36
|
+
type: import("zod").ZodLiteral<"embed">;
|
|
37
|
+
sessionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
38
|
+
requestId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
39
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
40
|
+
modelId: import("zod").ZodString;
|
|
41
|
+
text: import("zod").ZodOptional<import("zod").ZodNever>;
|
|
42
|
+
inputs: import("zod").ZodOptional<import("zod").ZodNever>;
|
|
43
|
+
input: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
44
|
+
media: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
45
|
+
type: import("zod").ZodLiteral<"base64">;
|
|
46
|
+
value: import("zod").ZodString;
|
|
47
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
48
|
+
type: import("zod").ZodLiteral<"filePath">;
|
|
49
|
+
value: import("zod").ZodString;
|
|
50
|
+
}, import("zod/v4/core").$strip>], "type">;
|
|
51
|
+
}, import("zod/v4/core").$strip>]>>, import("zod").ZodObject<{
|
|
52
|
+
image: import("zod").ZodBase64;
|
|
53
|
+
width: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
54
|
+
height: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
55
|
+
channels: import("zod").ZodOptional<import("zod").ZodLiteral<3>>;
|
|
56
|
+
}, import("zod/v4/core").$strip>]>;
|
|
57
|
+
type: import("zod").ZodLiteral<"embed">;
|
|
58
|
+
sessionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
59
|
+
requestId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
60
|
+
}, import("zod/v4/core").$strip>]>, import("zod").ZodObject<{
|
|
61
|
+
type: import("zod").ZodLiteral<"embed">;
|
|
62
|
+
success: import("zod").ZodBoolean;
|
|
63
|
+
embedding: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodArray<import("zod").ZodNumber>, import("zod").ZodArray<import("zod").ZodArray<import("zod").ZodNumber>>]>>;
|
|
64
|
+
stats: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
65
|
+
totalTime: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
66
|
+
tokensPerSecond: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
67
|
+
totalTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
68
|
+
backendDevice: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
69
|
+
cpu: "cpu";
|
|
70
|
+
gpu: "gpu";
|
|
71
|
+
}>>;
|
|
72
|
+
contextSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
73
|
+
backendId: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
74
|
+
cpuFallbackNodes: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
75
|
+
weightBytes: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
76
|
+
}, import("zod/v4/core").$strip>>;
|
|
77
|
+
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
78
|
+
}, import("zod/v4/core").$strip>>;
|
|
79
|
+
embedBatch: import("../../../schemas/index.js").PluginHandlerDefinition<import("zod").ZodObject<{
|
|
80
|
+
modelId: import("zod").ZodString;
|
|
81
|
+
text: import("zod").ZodOptional<import("zod").ZodNever>;
|
|
82
|
+
input: import("zod").ZodOptional<import("zod").ZodNever>;
|
|
83
|
+
type: import("zod").ZodLiteral<"embedBatch">;
|
|
84
|
+
inputs: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
85
|
+
media: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
86
|
+
type: import("zod").ZodLiteral<"base64">;
|
|
87
|
+
value: import("zod").ZodString;
|
|
88
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
89
|
+
type: import("zod").ZodLiteral<"filePath">;
|
|
90
|
+
value: import("zod").ZodString;
|
|
91
|
+
}, import("zod/v4/core").$strip>], "type">;
|
|
92
|
+
}, import("zod/v4/core").$strip>]>>, import("zod").ZodObject<{
|
|
93
|
+
image: import("zod").ZodBase64;
|
|
94
|
+
width: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
95
|
+
height: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
96
|
+
channels: import("zod").ZodOptional<import("zod").ZodLiteral<3>>;
|
|
97
|
+
}, import("zod/v4/core").$strip>]>>;
|
|
98
|
+
sessionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
99
|
+
requestId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
100
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
101
|
+
success: import("zod").ZodBoolean;
|
|
102
|
+
stats: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
103
|
+
totalTime: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
104
|
+
tokensPerSecond: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
105
|
+
totalTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
106
|
+
backendDevice: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
107
|
+
cpu: "cpu";
|
|
108
|
+
gpu: "gpu";
|
|
109
|
+
}>>;
|
|
110
|
+
contextSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
111
|
+
backendId: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
112
|
+
cpuFallbackNodes: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
113
|
+
weightBytes: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
114
|
+
}, import("zod/v4/core").$strip>>;
|
|
115
|
+
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
116
|
+
type: import("zod").ZodLiteral<"embedBatch">;
|
|
117
|
+
embedding: import("zod").ZodArray<import("zod").ZodArray<import("zod").ZodNumber>>;
|
|
118
|
+
}, import("zod/v4/core").$strip>>;
|
|
119
|
+
};
|
|
120
|
+
};
|