@agency-lang/whisper-local 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CMakeLists.txt +51 -0
- package/README.md +145 -0
- package/build/Release/whisper_addon.node +0 -0
- package/dist/src/addon.d.ts +11 -0
- package/dist/src/addon.js +22 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +117 -0
- package/dist/src/ffmpeg.d.ts +11 -0
- package/dist/src/ffmpeg.js +154 -0
- package/dist/src/handleCache.d.ts +9 -0
- package/dist/src/handleCache.js +83 -0
- package/dist/src/modelManager.d.ts +12 -0
- package/dist/src/modelManager.js +172 -0
- package/dist/src/packageRoot.d.ts +8 -0
- package/dist/src/packageRoot.js +21 -0
- package/dist/src/transcribe.d.ts +2 -0
- package/dist/src/transcribe.js +36 -0
- package/dist/src/types.d.ts +11 -0
- package/dist/src/types.js +17 -0
- package/index.agency +32 -0
- package/models.lock.json +55 -0
- package/package.json +52 -0
- package/vendor/whisper.cpp/CMakeLists.txt +251 -0
- package/vendor/whisper.cpp/LICENSE +21 -0
- package/vendor/whisper.cpp/UPSTREAM_SHA256 +1 -0
- package/vendor/whisper.cpp/VERSION +1 -0
- package/vendor/whisper.cpp/cmake/DefaultTargetOptions.cmake +16 -0
- package/vendor/whisper.cpp/cmake/FindFFmpeg.cmake +163 -0
- package/vendor/whisper.cpp/cmake/build-info.cmake +60 -0
- package/vendor/whisper.cpp/cmake/git-vars.cmake +22 -0
- package/vendor/whisper.cpp/cmake/whisper-config.cmake.in +65 -0
- package/vendor/whisper.cpp/cmake/whisper.pc.in +10 -0
- package/vendor/whisper.cpp/ggml/CMakeLists.txt +434 -0
- package/vendor/whisper.cpp/ggml/cmake/BuildTypes.cmake +54 -0
- package/vendor/whisper.cpp/ggml/cmake/GitVars.cmake +22 -0
- package/vendor/whisper.cpp/ggml/cmake/common.cmake +50 -0
- package/vendor/whisper.cpp/ggml/cmake/ggml-config.cmake.in +152 -0
- package/vendor/whisper.cpp/ggml/include/ggml-alloc.h +76 -0
- package/vendor/whisper.cpp/ggml/include/ggml-backend.h +354 -0
- package/vendor/whisper.cpp/ggml/include/ggml-blas.h +25 -0
- package/vendor/whisper.cpp/ggml/include/ggml-cann.h +123 -0
- package/vendor/whisper.cpp/ggml/include/ggml-cpp.h +39 -0
- package/vendor/whisper.cpp/ggml/include/ggml-cpu.h +143 -0
- package/vendor/whisper.cpp/ggml/include/ggml-cuda.h +47 -0
- package/vendor/whisper.cpp/ggml/include/ggml-kompute.h +50 -0
- package/vendor/whisper.cpp/ggml/include/ggml-metal.h +66 -0
- package/vendor/whisper.cpp/ggml/include/ggml-opencl.h +26 -0
- package/vendor/whisper.cpp/ggml/include/ggml-opt.h +237 -0
- package/vendor/whisper.cpp/ggml/include/ggml-rpc.h +33 -0
- package/vendor/whisper.cpp/ggml/include/ggml-sycl.h +49 -0
- package/vendor/whisper.cpp/ggml/include/ggml-vulkan.h +29 -0
- package/vendor/whisper.cpp/ggml/include/ggml.h +2221 -0
- package/vendor/whisper.cpp/ggml/include/gguf.h +202 -0
- package/vendor/whisper.cpp/ggml/src/CMakeLists.txt +404 -0
- package/vendor/whisper.cpp/ggml/src/ggml-alloc.c +1042 -0
- package/vendor/whisper.cpp/ggml/src/ggml-amx/CMakeLists.txt +107 -0
- package/vendor/whisper.cpp/ggml/src/ggml-amx/common.h +94 -0
- package/vendor/whisper.cpp/ggml/src/ggml-amx/ggml-amx.cpp +446 -0
- package/vendor/whisper.cpp/ggml/src/ggml-amx/mmq.cpp +2510 -0
- package/vendor/whisper.cpp/ggml/src/ggml-amx/mmq.h +17 -0
- package/vendor/whisper.cpp/ggml/src/ggml-backend-impl.h +255 -0
- package/vendor/whisper.cpp/ggml/src/ggml-backend-reg.cpp +591 -0
- package/vendor/whisper.cpp/ggml/src/ggml-backend.cpp +2016 -0
- package/vendor/whisper.cpp/ggml/src/ggml-blas/CMakeLists.txt +87 -0
- package/vendor/whisper.cpp/ggml/src/ggml-blas/ggml-blas.cpp +517 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/CMakeLists.txt +75 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/Doxyfile +2579 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/acl_tensor.cpp +181 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/acl_tensor.h +258 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/aclnn_ops.cpp +3193 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/aclnn_ops.h +1125 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/common.h +425 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/ggml-cann.cpp +2630 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/kernels/CMakeLists.txt +30 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/kernels/ascendc_kernels.h +19 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/kernels/dup.cpp +234 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/kernels/get_row_f16.cpp +197 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/kernels/get_row_f32.cpp +190 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/kernels/get_row_q4_0.cpp +204 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/kernels/get_row_q8_0.cpp +191 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/kernels/quantize_f16_q8_0.cpp +218 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/kernels/quantize_f32_q8_0.cpp +216 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cann/kernels/quantize_float_to_q4_0.cpp +295 -0
- package/vendor/whisper.cpp/ggml/src/ggml-common.h +1861 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/CMakeLists.txt +584 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/amx/amx.cpp +221 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/amx/amx.h +8 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/amx/common.h +91 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/amx/mmq.cpp +2511 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/amx/mmq.h +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/arch/arm/cpu-feats.cpp +94 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/arch/arm/quants.c +4113 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/arch/arm/repack.cpp +2162 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/arch/loongarch/quants.c +2638 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/arch/powerpc/cpu-feats.cpp +82 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/arch/powerpc/quants.c +2731 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/arch/riscv/quants.c +2068 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/arch/riscv/repack.cpp +396 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/arch/s390/quants.c +1299 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/arch/wasm/quants.c +1480 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/arch/x86/cpu-feats.cpp +327 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/arch/x86/quants.c +4310 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/arch/x86/repack.cpp +3284 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/arch-fallback.h +184 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/binary-ops.cpp +158 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/binary-ops.h +16 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/cmake/FindSIMD.cmake +100 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/common.h +72 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/ggml-cpu-impl.h +511 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/ggml-cpu.c +3473 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/ggml-cpu.cpp +671 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/hbm.cpp +55 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/hbm.h +8 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/kleidiai/kernels.cpp +337 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/kleidiai/kernels.h +95 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/kleidiai/kleidiai.cpp +482 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/kleidiai/kleidiai.h +17 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/llamafile/sgemm.cpp +3593 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/llamafile/sgemm.h +19 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/ops.cpp +9085 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/ops.h +111 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/quants.c +1157 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/quants.h +89 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/repack.cpp +1570 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/repack.h +98 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/simd-mappings.h +1006 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/traits.cpp +36 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/traits.h +38 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/unary-ops.cpp +186 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/unary-ops.h +28 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/vec.cpp +321 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cpu/vec.h +973 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/CMakeLists.txt +184 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/acc.cu +61 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/acc.cuh +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/arange.cu +34 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/arange.cuh +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/argmax.cu +91 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/argmax.cuh +3 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/argsort.cu +104 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/argsort.cuh +3 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/binbcast.cu +363 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/binbcast.cuh +9 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/clamp.cu +45 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/clamp.cuh +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/common.cuh +812 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/concat.cu +221 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/concat.cuh +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/conv-transpose-1d.cu +89 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/conv-transpose-1d.cuh +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/conv2d-dw.cu +161 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/conv2d-dw.cuh +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/conv2d-transpose.cu +91 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/conv2d-transpose.cuh +4 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/convert.cu +730 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/convert.cuh +26 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/count-equal.cu +64 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/count-equal.cuh +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/cp-async.cuh +57 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/cpy.cu +705 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/cpy.cuh +11 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/cross-entropy-loss.cu +189 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/cross-entropy-loss.cuh +7 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/dequantize.cuh +103 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/diagmask.cu +40 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/diagmask.cuh +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/fattn-common.cuh +881 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/fattn-mma-f16.cuh +1474 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/fattn-tile-f16.cu +357 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/fattn-tile-f16.cuh +3 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/fattn-tile-f32.cu +365 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/fattn-tile-f32.cuh +3 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/fattn-vec-f16.cuh +482 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/fattn-vec-f32.cuh +472 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/fattn-wmma-f16.cu +634 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/fattn-wmma-f16.cuh +3 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/fattn.cu +346 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/fattn.cuh +3 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/getrows.cu +275 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/getrows.cuh +15 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/ggml-cuda.cu +3562 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/gla.cu +93 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/gla.cuh +3 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/im2col.cu +103 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/im2col.cuh +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/mma.cuh +396 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/mmq.cu +324 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/mmq.cuh +3217 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/mmv.cu +336 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/mmv.cuh +12 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/mmvq.cu +595 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/mmvq.cuh +12 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/norm.cu +458 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/norm.cuh +11 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/opt-step-adamw.cu +78 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/opt-step-adamw.cuh +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/out-prod.cu +68 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/out-prod.cuh +3 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/pad.cu +49 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/pad.cuh +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/pool2d.cu +94 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/pool2d.cuh +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/quantize.cu +190 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/quantize.cuh +27 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/rope.cu +456 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/rope.cuh +7 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/scale.cu +31 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/scale.cuh +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/softmax.cu +283 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/softmax.cuh +7 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/ssm-conv.cu +148 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/ssm-conv.cuh +3 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/ssm-scan.cu +155 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/ssm-scan.cuh +3 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/sum.cu +45 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/sum.cuh +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/sumrows.cu +39 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/sumrows.cuh +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_1-ncols2_16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_1-ncols2_8.cu +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_16-ncols2_1.cu +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_16-ncols2_2.cu +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_16-ncols2_4.cu +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_4.cu +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_2-ncols2_8.cu +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_32-ncols2_1.cu +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_32-ncols2_2.cu +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_2.cu +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_4.cu +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_4-ncols2_8.cu +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_64-ncols2_1.cu +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_1.cu +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_2.cu +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_4.cu +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-mma-f16-instance-ncols1_8-ncols2_8.cu +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-f16-f16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-f16-q4_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-f16-q4_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-f16-q5_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-f16-q5_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-f16-q8_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_0-f16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_0-q4_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_0-q4_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_0-q5_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_0-q5_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_0-q8_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_1-f16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_1-q4_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_1-q4_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_1-q5_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_1-q5_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q4_1-q8_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_0-f16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_0-q4_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_0-q4_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_0-q5_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_0-q5_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_0-q8_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_1-f16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_1-q4_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_1-q4_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_1-q5_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_1-q5_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q5_1-q8_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q8_0-f16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q8_0-q4_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q8_0-q4_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q8_0-q5_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q8_0-q5_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs128-q8_0-q8_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs256-f16-f16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs64-f16-f16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs64-f16-q4_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs64-f16-q4_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs64-f16-q5_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs64-f16-q5_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f16-instance-hs64-f16-q8_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-f16-f16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-f16-q4_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-f16-q4_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-f16-q5_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-f16-q5_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-f16-q8_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_0-f16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_0-q4_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_0-q4_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_0-q5_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_0-q5_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_0-q8_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_1-f16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_1-q4_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_1-q4_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_1-q5_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_1-q5_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q4_1-q8_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_0-f16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_0-q4_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_0-q4_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_0-q5_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_0-q5_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_0-q8_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_1-f16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_1-q4_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_1-q4_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_1-q5_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_1-q5_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q5_1-q8_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q8_0-f16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q8_0-q4_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q8_0-q4_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q8_0-q5_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q8_0-q5_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs128-q8_0-q8_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs256-f16-f16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs64-f16-f16.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs64-f16-q4_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs64-f16-q4_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs64-f16-q5_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs64-f16-q5_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/fattn-vec-f32-instance-hs64-f16-q8_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/generate_cu_files.py +78 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq1_s.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq2_s.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq2_xs.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq2_xxs.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq3_s.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq3_xxs.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq4_nl.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-iq4_xs.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q2_k.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q3_k.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q4_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q4_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q4_k.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q5_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q5_1.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q5_k.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q6_k.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/template-instances/mmq-instance-q8_0.cu +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/tsembd.cu +47 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/tsembd.cuh +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/unary.cu +289 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/unary.cuh +59 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/upscale.cu +51 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/upscale.cuh +5 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/vecdotq.cuh +1135 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/vendors/cuda.h +15 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/vendors/hip.h +243 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/vendors/musa.h +140 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/wkv.cu +199 -0
- package/vendor/whisper.cpp/ggml/src/ggml-cuda/wkv.cuh +7 -0
- package/vendor/whisper.cpp/ggml/src/ggml-hip/CMakeLists.txt +135 -0
- package/vendor/whisper.cpp/ggml/src/ggml-impl.h +603 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/CMakeLists.txt +166 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/ggml-kompute.cpp +2251 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/common.comp +112 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_add.comp +58 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_addrow.comp +25 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_cpy_f16_f16.comp +52 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_cpy_f16_f32.comp +52 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_cpy_f32_f16.comp +52 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_cpy_f32_f32.comp +52 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_diagmask.comp +30 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_gelu.comp +22 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_getrows.comp +17 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_getrows_f16.comp +31 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_getrows_f32.comp +31 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_getrows_q4_0.comp +38 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_getrows_q4_1.comp +39 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_getrows_q6_k.comp +44 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul.comp +52 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mat_f16.comp +69 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mat_mat_f32.comp +51 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mat_q4_0.comp +33 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mat_q4_1.comp +35 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mat_q4_k.comp +140 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mat_q6_k.comp +106 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mat_q8_0.comp +73 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mv_q_n.comp +52 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_mul_mv_q_n_pre.comp +28 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_norm.comp +84 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_relu.comp +21 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_rmsnorm.comp +53 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_rope_neox_f16.comp +52 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_rope_neox_f32.comp +52 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_rope_norm_f16.comp +52 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_rope_norm_f32.comp +52 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_scale.comp +19 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_scale_8.comp +23 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_silu.comp +22 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/op_softmax.comp +72 -0
- package/vendor/whisper.cpp/ggml/src/ggml-kompute/kompute-shaders/rope_common.comp +71 -0
- package/vendor/whisper.cpp/ggml/src/ggml-metal/CMakeLists.txt +121 -0
- package/vendor/whisper.cpp/ggml/src/ggml-metal/ggml-metal-impl.h +622 -0
- package/vendor/whisper.cpp/ggml/src/ggml-metal/ggml-metal.m +6023 -0
- package/vendor/whisper.cpp/ggml/src/ggml-metal/ggml-metal.metal +7124 -0
- package/vendor/whisper.cpp/ggml/src/ggml-musa/CMakeLists.txt +113 -0
- package/vendor/whisper.cpp/ggml/src/ggml-musa/mudnn.cu +112 -0
- package/vendor/whisper.cpp/ggml/src/ggml-musa/mudnn.cuh +12 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/CMakeLists.txt +109 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/ggml-opencl.cpp +6665 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/add.cl +83 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/argsort.cl +86 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/clamp.cl +20 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/concat.cl +109 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/cpy.cl +184 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/cvt.cl +118 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/diag_mask_inf.cl +58 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/div.cl +72 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/embed_kernel.py +26 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/gelu.cl +62 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/gemv_noshuffle.cl +268 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/gemv_noshuffle_general.cl +274 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/get_rows.cl +163 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/group_norm.cl +72 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/im2col_f16.cl +57 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/im2col_f32.cl +57 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/mul.cl +79 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/mul_mat_Ab_Bi_8x4.cl +139 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/mul_mv_f16_f16.cl +118 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/mul_mv_f16_f32.cl +118 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/mul_mv_f16_f32_1row.cl +94 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/mul_mv_f16_f32_l4.cl +84 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/mul_mv_f32_f32.cl +118 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/mul_mv_id_q4_0_f32_8x_flat.cl +283 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32.cl +192 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32_1d_16x_flat.cl +307 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32_1d_8x_flat.cl +265 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32_8x_flat.cl +272 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/mul_mv_q4_0_f32_v.cl +254 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/mul_mv_q6_k.cl +190 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/norm.cl +81 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/pad.cl +30 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/relu.cl +16 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/repeat.cl +39 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/rms_norm.cl +96 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/rope.cl +721 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/scale.cl +16 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/sigmoid.cl +29 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/silu.cl +30 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/softmax_4_f16.cl +87 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/softmax_4_f32.cl +87 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/softmax_f16.cl +86 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/softmax_f32.cl +86 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/sub.cl +72 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/sum_rows.cl +39 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/tanh.cl +63 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/transpose.cl +84 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/tsembd.cl +48 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opencl/kernels/upscale.cl +121 -0
- package/vendor/whisper.cpp/ggml/src/ggml-opt.cpp +1037 -0
- package/vendor/whisper.cpp/ggml/src/ggml-quants.c +5230 -0
- package/vendor/whisper.cpp/ggml/src/ggml-quants.h +100 -0
- package/vendor/whisper.cpp/ggml/src/ggml-rpc/CMakeLists.txt +9 -0
- package/vendor/whisper.cpp/ggml/src/ggml-rpc/ggml-rpc.cpp +1816 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/CMakeLists.txt +189 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/backend.hpp +37 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/binbcast.cpp +344 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/binbcast.hpp +39 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/common.cpp +83 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/common.hpp +584 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/concat.cpp +182 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/concat.hpp +20 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/conv.cpp +95 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/conv.hpp +20 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/convert.cpp +575 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/convert.hpp +34 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/cpy.cpp +839 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/cpy.hpp +11 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/dequantize.hpp +823 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/dmmv.cpp +1144 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/dmmv.hpp +27 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/dpct/helper.hpp +2987 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/element_wise.cpp +1511 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/element_wise.hpp +77 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/gemm.hpp +102 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/getrows.cpp +212 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/getrows.hpp +20 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/ggml-sycl.cpp +4608 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/gla.cpp +106 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/gla.hpp +8 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/im2col.cpp +136 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/im2col.hpp +21 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/mmq.cpp +3010 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/mmq.hpp +33 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/mmvq.cpp +1065 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/mmvq.hpp +27 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/norm.cpp +482 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/norm.hpp +26 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/outprod.cpp +47 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/outprod.hpp +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/presets.hpp +74 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/quants.hpp +111 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/rope.cpp +472 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/rope.hpp +20 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/softmax.cpp +261 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/softmax.hpp +20 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/sycl_hw.cpp +13 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/sycl_hw.hpp +23 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/tsembd.cpp +67 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/tsembd.hpp +20 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/vecdotq.hpp +1307 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/wkv.cpp +289 -0
- package/vendor/whisper.cpp/ggml/src/ggml-sycl/wkv.hpp +10 -0
- package/vendor/whisper.cpp/ggml/src/ggml-threading.cpp +12 -0
- package/vendor/whisper.cpp/ggml/src/ggml-threading.h +14 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/CMakeLists.txt +189 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/cmake/host-toolchain.cmake.in +15 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp +10937 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/CMakeLists.txt +27 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/acc.comp +29 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/add.comp +29 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/argmax.comp +51 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/argsort.comp +69 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/clamp.comp +17 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/concat.comp +41 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/contig_copy.comp +49 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/conv2d_dw.comp +105 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/conv_transpose_1d.comp +98 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/copy.comp +23 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/copy_from_quant.comp +51 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/copy_to_quant.comp +242 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/cos.comp +17 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/count_equal.comp +31 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_f32.comp +20 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_funcs.comp +462 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_funcs_cm2.comp +699 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_head.comp +13 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq1_m.comp +42 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq1_s.comp +35 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq2_s.comp +44 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq2_xs.comp +43 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq2_xxs.comp +48 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq3_s.comp +39 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq3_xxs.comp +49 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq4_nl.comp +32 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_iq4_xs.comp +34 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q2_k.comp +34 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q3_k.comp +42 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q4_0.comp +30 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q4_1.comp +32 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q4_k.comp +68 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q5_0.comp +34 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q5_1.comp +35 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q5_k.comp +70 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q6_k.comp +33 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/dequant_q8_0.comp +31 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/diag_mask_inf.comp +34 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/div.comp +27 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn.comp +337 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_base.comp +162 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_cm1.comp +360 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_cm2.comp +267 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_split_k_reduce.comp +59 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/gelu.comp +25 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/gelu_quick.comp +23 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/generic_binary_head.comp +64 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/generic_head.comp +9 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/generic_unary_head.comp +76 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/get_rows.comp +33 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/get_rows_quant.comp +41 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/group_norm.comp +66 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/im2col.comp +100 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/l2_norm.comp +41 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/leaky_relu.comp +22 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul.comp +27 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_split_k_reduce.comp +48 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec.comp +169 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_base.comp +118 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq1_m.comp +82 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq1_s.comp +79 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq2_s.comp +90 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq2_xs.comp +87 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq2_xxs.comp +87 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq3_s.comp +90 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_iq3_xxs.comp +88 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_nc.comp +118 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_p021.comp +154 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q2_k.comp +130 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q3_k.comp +132 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q4_k.comp +136 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q5_k.comp +167 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mat_vec_q6_k.comp +130 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mm.comp +868 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mm_cm2.comp +441 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mmq.comp +442 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/mul_mmq_funcs.comp +99 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/norm.comp +44 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/opt_step_adamw.comp +42 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/pad.comp +28 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/pool2d.comp +74 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/quantize_q8_1.comp +77 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/relu.comp +21 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/repeat.comp +26 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/repeat_back.comp +37 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/rms_norm.comp +52 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/rms_norm_back.comp +55 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/rope_head.comp +58 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/rope_multi.comp +60 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/rope_neox.comp +43 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/rope_norm.comp +43 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/rope_vision.comp +47 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/scale.comp +24 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/sigmoid.comp +20 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/silu.comp +22 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/silu_back.comp +26 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/sin.comp +17 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/soft_max.comp +173 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/soft_max_back.comp +50 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/square.comp +17 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/sub.comp +29 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/sum_rows.comp +37 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/tanh.comp +20 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/test_bfloat16_support.comp +7 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/test_coopmat2_support.comp +7 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/test_coopmat_support.comp +7 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/test_integer_dot_support.comp +7 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/timestep_embedding.comp +41 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/types.comp +1373 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/upscale.comp +36 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp +753 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/wkv6.comp +87 -0
- package/vendor/whisper.cpp/ggml/src/ggml-vulkan/vulkan-shaders/wkv7.comp +91 -0
- package/vendor/whisper.cpp/ggml/src/ggml.c +6601 -0
- package/vendor/whisper.cpp/ggml/src/ggml.cpp +26 -0
- package/vendor/whisper.cpp/ggml/src/gguf.cpp +1347 -0
- package/vendor/whisper.cpp/include/whisper.h +738 -0
- package/vendor/whisper.cpp/src/CMakeLists.txt +145 -0
- package/vendor/whisper.cpp/src/coreml/whisper-compat.h +10 -0
- package/vendor/whisper.cpp/src/coreml/whisper-compat.m +35 -0
- package/vendor/whisper.cpp/src/coreml/whisper-decoder-impl.h +158 -0
- package/vendor/whisper.cpp/src/coreml/whisper-decoder-impl.m +227 -0
- package/vendor/whisper.cpp/src/coreml/whisper-encoder-impl.h +154 -0
- package/vendor/whisper.cpp/src/coreml/whisper-encoder-impl.m +223 -0
- package/vendor/whisper.cpp/src/coreml/whisper-encoder.h +26 -0
- package/vendor/whisper.cpp/src/coreml/whisper-encoder.mm +73 -0
- package/vendor/whisper.cpp/src/openvino/whisper-openvino-encoder.cpp +108 -0
- package/vendor/whisper.cpp/src/openvino/whisper-openvino-encoder.h +31 -0
- package/vendor/whisper.cpp/src/whisper-arch.h +197 -0
- package/vendor/whisper.cpp/src/whisper.cpp +8969 -0
package/CMakeLists.txt
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.18)
|
|
2
|
+
project(whisper_addon)
|
|
3
|
+
|
|
4
|
+
set(CMAKE_CXX_STANDARD 17)
|
|
5
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
6
|
+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
7
|
+
|
|
8
|
+
# --- whisper.cpp + ggml as static libs ---
|
|
9
|
+
set(WHISPER_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
|
10
|
+
set(WHISPER_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
|
11
|
+
set(WHISPER_BUILD_SERVER OFF CACHE BOOL "" FORCE)
|
|
12
|
+
set(GGML_BLAS OFF CACHE BOOL "" FORCE)
|
|
13
|
+
|
|
14
|
+
# Build whisper as a static lib so we can link it into the addon .node file.
|
|
15
|
+
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
|
|
16
|
+
|
|
17
|
+
# macOS: enable Metal acceleration (free, no API surface needed)
|
|
18
|
+
if(APPLE)
|
|
19
|
+
set(GGML_METAL ON CACHE BOOL "" FORCE)
|
|
20
|
+
set(GGML_METAL_EMBED_LIBRARY ON CACHE BOOL "" FORCE)
|
|
21
|
+
else()
|
|
22
|
+
set(GGML_METAL OFF CACHE BOOL "" FORCE)
|
|
23
|
+
endif()
|
|
24
|
+
|
|
25
|
+
# Pull in the whole vendored whisper.cpp tree using its own top-level CMakeLists.
|
|
26
|
+
add_subdirectory(vendor/whisper.cpp)
|
|
27
|
+
|
|
28
|
+
# --- N-API addon ---
|
|
29
|
+
include_directories(${CMAKE_JS_INC})
|
|
30
|
+
|
|
31
|
+
file(GLOB ADDON_SOURCES "src/addon.cc")
|
|
32
|
+
add_library(${PROJECT_NAME} SHARED ${ADDON_SOURCES} ${CMAKE_JS_SRC})
|
|
33
|
+
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node")
|
|
34
|
+
|
|
35
|
+
target_include_directories(${PROJECT_NAME} PRIVATE
|
|
36
|
+
vendor/whisper.cpp/include
|
|
37
|
+
vendor/whisper.cpp/ggml/include
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
target_link_libraries(${PROJECT_NAME} PRIVATE whisper ${CMAKE_JS_LIB})
|
|
41
|
+
|
|
42
|
+
# node-addon-api headers
|
|
43
|
+
execute_process(
|
|
44
|
+
COMMAND node -p "require('node-addon-api').include"
|
|
45
|
+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
46
|
+
OUTPUT_VARIABLE NODE_ADDON_API_DIR
|
|
47
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
48
|
+
)
|
|
49
|
+
string(REGEX REPLACE "\"" "" NODE_ADDON_API_DIR ${NODE_ADDON_API_DIR})
|
|
50
|
+
target_include_directories(${PROJECT_NAME} PRIVATE ${NODE_ADDON_API_DIR})
|
|
51
|
+
add_definitions(-DNAPI_VERSION=8)
|
package/README.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# @agency-lang/whisper-local
|
|
2
|
+
|
|
3
|
+
Local Whisper transcription for Agency. No network at runtime, no API key, no data leaves your machine.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
This package ships as source and ships **no** install/postinstall scripts — `npm install` will not run a compiler or fetch anything. After installing, run the explicit build step below to compile the native addon. This is intentional: postinstall scripts are the most common npm supply-chain attack vector, and silently invoking `cmake` on every install would surprise users who pulled the package as a transitive dependency.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
# 1. Install (no compilation, no network beyond the npm download itself)
|
|
11
|
+
npm install @agency-lang/whisper-local
|
|
12
|
+
|
|
13
|
+
# 2. Explicitly build the native addon (one-time, ~30-90 seconds)
|
|
14
|
+
npx -p @agency-lang/whisper-local agency-whisper build
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**System dependencies (install before running `agency-whisper build`):**
|
|
18
|
+
|
|
19
|
+
| Platform | Build tools | Audio decoding |
|
|
20
|
+
|----------|-------------|----------------|
|
|
21
|
+
| macOS | `xcode-select --install && brew install cmake` | `brew install ffmpeg` |
|
|
22
|
+
| Debian/Ubuntu | `sudo apt install cmake build-essential` | `sudo apt install ffmpeg` |
|
|
23
|
+
| Fedora | `sudo dnf install cmake gcc-c++` | `sudo dnf install ffmpeg` |
|
|
24
|
+
| Windows | Not yet supported in source-build v0; wait for prebuilts. | — |
|
|
25
|
+
|
|
26
|
+
If `agency-whisper build` fails because of missing build tools, the rest of your `node_modules/` is unaffected.
|
|
27
|
+
|
|
28
|
+
## Quick start
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { transcribe } from "pkg::@agency-lang/whisper-local"
|
|
32
|
+
|
|
33
|
+
node main() {
|
|
34
|
+
const text = transcribe("interview.m4a", "en", "base.en")
|
|
35
|
+
print(text)
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The first call downloads `ggml-base.en.bin` (~150 MB) into `~/.agency/models/whisper/`. Subsequent calls reuse the cached file.
|
|
40
|
+
|
|
41
|
+
## API
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
transcribe(filepath: string, language: string = "", model: string = "base.en"): string
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
- `filepath` — any audio file ffmpeg can read (mp3, m4a, wav, flac, ogg, webm, mp4, …). Must be a regular file on the local filesystem; URLs and ffmpeg pseudo-protocols (`http://`, `concat:`, `subfile:`, …) are explicitly rejected. See [Operational notes](#operational-notes).
|
|
48
|
+
- `language` — ISO 639-1 code (e.g. `"en"`, `"fr"`, `"de"`). Empty string → whisper.cpp auto-detects.
|
|
49
|
+
- `model` — model name. See the table below.
|
|
50
|
+
|
|
51
|
+
Returns the joined transcript text. Throws on missing ffmpeg, unknown model, corrupted audio, or SHA-256 mismatch on model download.
|
|
52
|
+
|
|
53
|
+
## Models
|
|
54
|
+
|
|
55
|
+
All ten upstream whisper.cpp models are pinned in `models.lock.json` against HuggingFace commit [`5359861c…`](https://huggingface.co/ggerganov/whisper.cpp/tree/5359861c739e955e79d9a303bcbc70fb988958b1) with verified SHA-256 hashes.
|
|
56
|
+
|
|
57
|
+
| Name | Size | English-only | Notes |
|
|
58
|
+
|------|------|--------------|-------|
|
|
59
|
+
| `tiny` | 75 MB | no | Fastest, lowest accuracy. Good for quick prototypes. |
|
|
60
|
+
| `tiny.en` | 75 MB | yes | English-only variant of `tiny`; slightly more accurate. |
|
|
61
|
+
| `base` | 142 MB | no | Multilingual base model. |
|
|
62
|
+
| `base.en` | 142 MB | yes | **Default.** Good accuracy/speed trade-off for English. |
|
|
63
|
+
| `small` | 466 MB | no | Noticeable accuracy bump over `base`. |
|
|
64
|
+
| `small.en` | 466 MB | yes | English-only variant of `small`. |
|
|
65
|
+
| `medium` | 1.5 GB | no | Slow on CPU; usable on Apple Silicon. |
|
|
66
|
+
| `medium.en` | 1.5 GB | yes | English-only variant of `medium`. |
|
|
67
|
+
| `large-v3` | 2.9 GB | no | Best accuracy. Use only with adequate RAM (~5 GB peak). |
|
|
68
|
+
| `large-v3-turbo` | 1.6 GB | no | Approaches `large-v3` quality at ~half the size. |
|
|
69
|
+
|
|
70
|
+
`.en` variants are slightly more accurate on English-only audio. To add a model from a newer upstream release, see [`docs/DEV.md`](./docs/DEV.md#adding-a-model).
|
|
71
|
+
|
|
72
|
+
## Pre-downloading models
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
npx -p @agency-lang/whisper-local agency-whisper pull base.en
|
|
76
|
+
npx -p @agency-lang/whisper-local agency-whisper list
|
|
77
|
+
npx -p @agency-lang/whisper-local agency-whisper verify base.en
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Manual model placement
|
|
81
|
+
|
|
82
|
+
If you can't reach HuggingFace (network-restricted environment, etc.), download `ggml-<name>.bin` yourself and place it at `~/.agency/models/whisper/ggml-<name>.bin`. The package will use it as-is, without re-hashing on every load. To verify a manually-placed file:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
npx -p @agency-lang/whisper-local agency-whisper verify <name>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Custom model directory
|
|
89
|
+
|
|
90
|
+
Set `AGENCY_WHISPER_MODELS_DIR` to use a directory other than `~/.agency/models/whisper/`.
|
|
91
|
+
|
|
92
|
+
## Operational notes
|
|
93
|
+
|
|
94
|
+
**Threading.** The native addon runs whisper inference on a libuv worker thread (`Napi::AsyncWorker`), so the JavaScript event loop is *not* blocked during a `transcribe()` call. Other JS work — HTTP requests, timers, etc. — continues to run.
|
|
95
|
+
|
|
96
|
+
**Per-model serialization.** A `whisper_context` is mutable internal state. We hold a per-model mutex around `whisper_full`, so concurrent `transcribe()` calls on the *same* model serialize cleanly (no races, no corruption) but do not run in parallel. Throughput per model is single-threaded.
|
|
97
|
+
|
|
98
|
+
**Cross-model parallelism.** Calls on *different* model instances run concurrently on separate libuv worker threads. By default Node sizes the libuv pool at 4 threads. If you run many concurrent transcriptions in the same process (e.g. an Agency program serving multiple users), bump the pool: `UV_THREADPOOL_SIZE=16 node ...` Do this *before* node starts; the pool size is locked at startup.
|
|
99
|
+
|
|
100
|
+
**Loaded-model cache.** Loaded model contexts are kept in an in-process LRU cache. The default cap is 2 entries (a `large-v3` context can use ~3 GB, so an unbounded cache is dangerous in long-lived processes). Override via `AGENCY_WHISPER_HANDLE_CACHE_MAX`. Set to `0` to disable the cache (load + free per `transcribe()`).
|
|
101
|
+
|
|
102
|
+
**Memory profile.** The audio decode step buffers the entire decoded PCM in memory before handing it to whisper. At 16 kHz mono float32 that is ~230 MB per hour of audio. Peak RSS during a transcribe is roughly 3× the decoded size (decoded buffer + Float32Array copy + C++ `std::vector` copy). The package rejects any single decode that exceeds 2 GB by default; override per-call via the lower-level `decodeToPcm({ maxPcmBytes })` API or chunk long audio client-side.
|
|
103
|
+
|
|
104
|
+
**Timeout.** Each ffmpeg invocation has a 10-minute wall-clock cap (configurable via `decodeToPcm({ timeoutMs })`). On expiry the ffmpeg process is `SIGKILL`-ed and the call rejects, so a stuck or pathological input cannot hold the worker forever.
|
|
105
|
+
|
|
106
|
+
**Input restriction.** `transcribe(filepath)` validates that `filepath` is a regular file before spawning ffmpeg, and the spawn is restricted to ffmpeg's `file` protocol. Inputs starting with `-` or specifying any other protocol (`http://`, `tcp://`, `concat:`, `subfile:`, …) are rejected up front. This matters because Agency programs often pass LLM-driven tool arguments straight into `transcribe()`; without this guard, a crafted "filepath" could turn a transcription into an outbound HTTP fetch or a read of an arbitrary local file.
|
|
107
|
+
|
|
108
|
+
## Troubleshooting
|
|
109
|
+
|
|
110
|
+
**`cmake: command not found`** — install cmake (see the install table).
|
|
111
|
+
|
|
112
|
+
**`ffmpeg not found on PATH`** — install ffmpeg (see the install table).
|
|
113
|
+
|
|
114
|
+
**`whisper_init_from_file_with_params failed`** — the `.bin` file is corrupted or not a whisper.cpp ggml format. Re-download with `agency-whisper pull <name>` or run `agency-whisper verify <name>` to check.
|
|
115
|
+
|
|
116
|
+
**`SHA-256 mismatch`** — the downloaded model's hash doesn't match the lockfile. The partial file has been deleted. Re-running usually succeeds; if it persists, file an issue.
|
|
117
|
+
|
|
118
|
+
**`whisper-local native addon not found`** — you skipped step 2 of installation. Run `npx -p @agency-lang/whisper-local agency-whisper build`.
|
|
119
|
+
|
|
120
|
+
## Not in v0
|
|
121
|
+
|
|
122
|
+
- Prebuilt binaries (will arrive via an optional-deps platform matrix).
|
|
123
|
+
- Windows source-build support.
|
|
124
|
+
- Streaming partial results.
|
|
125
|
+
- Speaker diarization.
|
|
126
|
+
- Translation mode.
|
|
127
|
+
|
|
128
|
+
## For maintainers / contributors
|
|
129
|
+
|
|
130
|
+
See [`docs/DEV.md`](./docs/DEV.md) for architecture, security model, C++ memory design, vendoring procedure, and testing notes.
|
|
131
|
+
|
|
132
|
+
## Credits
|
|
133
|
+
|
|
134
|
+
This package vendors and depends on:
|
|
135
|
+
|
|
136
|
+
- **[whisper.cpp](https://github.com/ggml-org/whisper.cpp)** by Georgi Gerganov and contributors — MIT License. See `vendor/whisper.cpp/LICENSE`. We use a pinned release; see `vendor/whisper.cpp/VERSION`.
|
|
137
|
+
- **[ggml](https://github.com/ggml-org/ggml)** by Georgi Gerganov and contributors — MIT License. Vendored alongside whisper.cpp.
|
|
138
|
+
- **[node-addon-api](https://github.com/nodejs/node-addon-api)** by the Node.js project — MIT License.
|
|
139
|
+
- **[cmake-js](https://github.com/cmake-js/cmake-js)** — MIT License.
|
|
140
|
+
|
|
141
|
+
Audio decoding shells out to your system's **[ffmpeg](https://ffmpeg.org)**, which is not bundled or distributed with this package.
|
|
142
|
+
|
|
143
|
+
## License
|
|
144
|
+
|
|
145
|
+
ISC. See repository root LICENSE file. Vendored whisper.cpp + ggml source is MIT-licensed; see `vendor/whisper.cpp/LICENSE` for that notice.
|
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type WhisperModelInstance = {
|
|
2
|
+
transcribe(pcm: Float32Array, opts?: {
|
|
3
|
+
language?: string;
|
|
4
|
+
translate?: boolean;
|
|
5
|
+
}): Promise<string[]>;
|
|
6
|
+
free(): void;
|
|
7
|
+
};
|
|
8
|
+
export type WhisperModelCtor = new (modelPath: string) => WhisperModelInstance;
|
|
9
|
+
export declare function loadAddon(): {
|
|
10
|
+
WhisperModel: WhisperModelCtor;
|
|
11
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import * as path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { findPackageRoot } from "./packageRoot.js";
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
9
|
+
let cached = null;
|
|
10
|
+
export function loadAddon() {
|
|
11
|
+
if (cached)
|
|
12
|
+
return cached;
|
|
13
|
+
const pkgRoot = findPackageRoot(__dirname);
|
|
14
|
+
const addonPath = path.join(pkgRoot, "build", "Release", "whisper_addon.node");
|
|
15
|
+
if (!existsSync(addonPath)) {
|
|
16
|
+
throw new Error(`whisper-local native addon not found at ${addonPath}. ` +
|
|
17
|
+
`Run \`npx -p @agency-lang/whisper-local agency-whisper build\` ` +
|
|
18
|
+
`to compile it. (No postinstall hook runs this for you — by design.)`);
|
|
19
|
+
}
|
|
20
|
+
cached = require(addonPath);
|
|
21
|
+
return cached;
|
|
22
|
+
}
|
package/dist/src/cli.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { loadLockfile, resolveModelDir, resolveModelPath, isModelInstalled, ensureModel, sha256OfFile, ModelManagerError, } from "./modelManager.js";
|
|
3
|
+
import * as fs from "node:fs/promises";
|
|
4
|
+
import { spawn } from "node:child_process";
|
|
5
|
+
import * as path from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
import { existsSync } from "node:fs";
|
|
8
|
+
import { findPackageRoot } from "./packageRoot.js";
|
|
9
|
+
async function cmdBuild() {
|
|
10
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
const pkgRoot = findPackageRoot(here);
|
|
12
|
+
console.log(`Building native addon in ${pkgRoot} ...`);
|
|
13
|
+
console.log("This compiles vendored whisper.cpp + ggml from source. Expect 30-90 seconds.");
|
|
14
|
+
console.log("Requires: cmake >= 3.18, a C++17 compiler. (ffmpeg is needed at runtime, not build time.)");
|
|
15
|
+
// We deliberately spawn the locally-installed cmake-js binary rather than
|
|
16
|
+
// invoking node's require system, so the user sees real cmake output and
|
|
17
|
+
// we don't accidentally execute vendored C++ via a hidden code path.
|
|
18
|
+
const cmakeJs = path.join(pkgRoot, "node_modules", ".bin", "cmake-js");
|
|
19
|
+
if (!existsSync(cmakeJs)) {
|
|
20
|
+
console.error(`cmake-js not found at ${cmakeJs}.`);
|
|
21
|
+
console.error(`Run \`npm install\` (or \`pnpm install\`) inside ${pkgRoot} first.`);
|
|
22
|
+
process.exit(5);
|
|
23
|
+
}
|
|
24
|
+
await new Promise((resolve, reject) => {
|
|
25
|
+
const child = spawn(cmakeJs, ["compile", "--runtime=node"], {
|
|
26
|
+
cwd: pkgRoot,
|
|
27
|
+
stdio: "inherit",
|
|
28
|
+
});
|
|
29
|
+
child.on("error", reject);
|
|
30
|
+
child.on("close", (code) => {
|
|
31
|
+
if (code === 0)
|
|
32
|
+
resolve();
|
|
33
|
+
else
|
|
34
|
+
reject(new Error(`cmake-js exited with code ${code}`));
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
const addonPath = path.join(pkgRoot, "build", "Release", "whisper_addon.node");
|
|
38
|
+
if (!existsSync(addonPath)) {
|
|
39
|
+
console.error(`Build reported success but addon not found at ${addonPath}.`);
|
|
40
|
+
process.exit(6);
|
|
41
|
+
}
|
|
42
|
+
console.log(`Built: ${addonPath}`);
|
|
43
|
+
}
|
|
44
|
+
async function cmdPull(name) {
|
|
45
|
+
await ensureModel(name);
|
|
46
|
+
console.log(`Installed: ${resolveModelPath(name)}`);
|
|
47
|
+
}
|
|
48
|
+
async function cmdList() {
|
|
49
|
+
const dir = resolveModelDir();
|
|
50
|
+
const lock = await loadLockfile();
|
|
51
|
+
console.log(`Models directory: ${dir}\n`);
|
|
52
|
+
for (const [name, entry] of Object.entries(lock.models)) {
|
|
53
|
+
const installed = await isModelInstalled(name, dir);
|
|
54
|
+
const sizeMb = Math.round(entry.sizeBytes / 1e6);
|
|
55
|
+
const tag = installed ? "✓" : " ";
|
|
56
|
+
console.log(` ${tag} ${name.padEnd(16)} ${String(sizeMb).padStart(5)} MB`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async function cmdVerify(name) {
|
|
60
|
+
const p = resolveModelPath(name);
|
|
61
|
+
const lock = await loadLockfile();
|
|
62
|
+
const entry = lock.models[name];
|
|
63
|
+
if (!entry)
|
|
64
|
+
throw new ModelManagerError(`unknown model "${name}"`);
|
|
65
|
+
try {
|
|
66
|
+
await fs.access(p);
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
console.error(`Not installed: ${p}`);
|
|
70
|
+
process.exit(2);
|
|
71
|
+
}
|
|
72
|
+
const actual = await sha256OfFile(p);
|
|
73
|
+
if (actual === entry.sha256) {
|
|
74
|
+
console.log(`OK: ${name} (${actual})`);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
console.error(`MISMATCH: ${name}`);
|
|
78
|
+
console.error(` expected ${entry.sha256}`);
|
|
79
|
+
console.error(` actual ${actual}`);
|
|
80
|
+
process.exit(3);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function usage() {
|
|
84
|
+
console.error("Usage: agency-whisper <command> [args]");
|
|
85
|
+
console.error(" build Compile the native addon (run once after install)");
|
|
86
|
+
console.error(" pull <model> Download a model (e.g. base.en)");
|
|
87
|
+
console.error(" list List supported models and installation status");
|
|
88
|
+
console.error(" verify <model> Re-hash an installed model and compare to lockfile");
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
const [, , cmd, ...rest] = process.argv;
|
|
92
|
+
try {
|
|
93
|
+
switch (cmd) {
|
|
94
|
+
case "build":
|
|
95
|
+
await cmdBuild();
|
|
96
|
+
break;
|
|
97
|
+
case "pull":
|
|
98
|
+
if (!rest[0])
|
|
99
|
+
usage();
|
|
100
|
+
await cmdPull(rest[0]);
|
|
101
|
+
break;
|
|
102
|
+
case "list":
|
|
103
|
+
await cmdList();
|
|
104
|
+
break;
|
|
105
|
+
case "verify":
|
|
106
|
+
if (!rest[0])
|
|
107
|
+
usage();
|
|
108
|
+
await cmdVerify(rest[0]);
|
|
109
|
+
break;
|
|
110
|
+
default:
|
|
111
|
+
usage();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
console.error(`Error: ${err.message}`);
|
|
116
|
+
process.exit(4);
|
|
117
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class FfmpegError extends Error {
|
|
2
|
+
constructor(message: string);
|
|
3
|
+
}
|
|
4
|
+
export declare const DEFAULT_FFMPEG_TIMEOUT_MS: number;
|
|
5
|
+
export declare const DEFAULT_MAX_PCM_BYTES: number;
|
|
6
|
+
export type DecodeOptions = {
|
|
7
|
+
timeoutMs?: number;
|
|
8
|
+
maxPcmBytes?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function buildFfmpegArgs(filepath: string): string[];
|
|
11
|
+
export declare function decodeToPcm(filepath: string, opts?: DecodeOptions): Promise<Float32Array>;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import * as fs from "node:fs/promises";
|
|
3
|
+
export class FfmpegError extends Error {
|
|
4
|
+
constructor(message) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.name = "FfmpegError";
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
// Default 10-minute wall clock per ffmpeg invocation. Overridable per-call so
|
|
10
|
+
// callers transcribing very long files can opt in to a higher cap.
|
|
11
|
+
export const DEFAULT_FFMPEG_TIMEOUT_MS = 10 * 60 * 1000;
|
|
12
|
+
// Default 2 GB cap on decoded PCM bytes (~2.4 hours of 16 kHz mono float32).
|
|
13
|
+
// Bounds memory growth on attacker-controlled or pathological input. Override
|
|
14
|
+
// per-call when intentionally transcribing very long audio.
|
|
15
|
+
export const DEFAULT_MAX_PCM_BYTES = 2 * 1024 * 1024 * 1024;
|
|
16
|
+
export function buildFfmpegArgs(filepath) {
|
|
17
|
+
return [
|
|
18
|
+
"-hide_banner",
|
|
19
|
+
"-loglevel",
|
|
20
|
+
"error",
|
|
21
|
+
// Restrict ffmpeg to the local file protocol. Without this, a filepath of
|
|
22
|
+
// "http://evil/x", "tcp://...", "concat:...", or "subfile,..." would make
|
|
23
|
+
// ffmpeg perform outbound network requests or read arbitrary local files
|
|
24
|
+
// outside the one we believe we're transcribing. Since transcribe() is
|
|
25
|
+
// commonly called with LLM-driven tool arguments in Agency programs, this
|
|
26
|
+
// matters: never let an attacker turn a transcription into a file read or
|
|
27
|
+
// SSRF.
|
|
28
|
+
"-protocol_whitelist",
|
|
29
|
+
"file",
|
|
30
|
+
"-i",
|
|
31
|
+
filepath,
|
|
32
|
+
"-ac",
|
|
33
|
+
"1",
|
|
34
|
+
"-ar",
|
|
35
|
+
"16000",
|
|
36
|
+
"-f",
|
|
37
|
+
"f32le",
|
|
38
|
+
"-",
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
function ffmpegInstallHint() {
|
|
42
|
+
switch (process.platform) {
|
|
43
|
+
case "darwin":
|
|
44
|
+
return "Install with: brew install ffmpeg";
|
|
45
|
+
case "linux":
|
|
46
|
+
return "Install with: apt install ffmpeg (or your distro's equivalent)";
|
|
47
|
+
case "win32":
|
|
48
|
+
return "Install from https://ffmpeg.org/download.html and ensure it's on PATH";
|
|
49
|
+
default:
|
|
50
|
+
return "Install ffmpeg and ensure it's on PATH";
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async function validateInputPath(filepath) {
|
|
54
|
+
// Reject anything that looks like a CLI flag (e.g. "-version", "-i").
|
|
55
|
+
// ffmpeg's positional input slot is occupied by the value after our literal
|
|
56
|
+
// "-i", so a leading-dash filepath cannot smuggle a flag at *that*
|
|
57
|
+
// position — but the `-protocol_whitelist file` argument earlier in the
|
|
58
|
+
// command line still leaves us vulnerable to confused-deputy bugs if the
|
|
59
|
+
// argument order ever changes. Reject up front; a real audio file never
|
|
60
|
+
// starts with "-".
|
|
61
|
+
if (filepath.startsWith("-")) {
|
|
62
|
+
throw new FfmpegError(`refusing path that starts with '-': ${filepath}`);
|
|
63
|
+
}
|
|
64
|
+
let st;
|
|
65
|
+
try {
|
|
66
|
+
st = await fs.stat(filepath);
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
throw new FfmpegError(`input file not found or unreadable: ${filepath} (${err.message})`);
|
|
70
|
+
}
|
|
71
|
+
if (!st.isFile()) {
|
|
72
|
+
throw new FfmpegError(`input is not a regular file: ${filepath}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
export async function decodeToPcm(filepath, opts = {}) {
|
|
76
|
+
await validateInputPath(filepath);
|
|
77
|
+
const timeoutMs = opts.timeoutMs ?? DEFAULT_FFMPEG_TIMEOUT_MS;
|
|
78
|
+
const maxPcmBytes = opts.maxPcmBytes ?? DEFAULT_MAX_PCM_BYTES;
|
|
79
|
+
const args = buildFfmpegArgs(filepath);
|
|
80
|
+
const proc = spawn("ffmpeg", args);
|
|
81
|
+
const stdoutChunks = [];
|
|
82
|
+
const stderrChunks = [];
|
|
83
|
+
let stdoutBytes = 0;
|
|
84
|
+
let oversizeRejected = false;
|
|
85
|
+
// Force-kill the process and tag the rejection. SIGKILL (vs SIGTERM) is
|
|
86
|
+
// intentional: a stuck or runaway ffmpeg may ignore TERM, and we'd rather
|
|
87
|
+
// strand a partial decode than leave a zombie holding CPU.
|
|
88
|
+
let killReason = null;
|
|
89
|
+
const kill = (reason) => {
|
|
90
|
+
if (killReason)
|
|
91
|
+
return;
|
|
92
|
+
killReason = reason;
|
|
93
|
+
try {
|
|
94
|
+
proc.kill("SIGKILL");
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
// Process may already be gone; the close handler still fires.
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
proc.stdout.on("data", (c) => {
|
|
101
|
+
stdoutBytes += c.byteLength;
|
|
102
|
+
if (stdoutBytes > maxPcmBytes && !oversizeRejected) {
|
|
103
|
+
oversizeRejected = true;
|
|
104
|
+
kill(`decoded output exceeded cap of ${maxPcmBytes} bytes ` +
|
|
105
|
+
`(~${Math.round(maxPcmBytes / (16000 * 4))} seconds of audio at 16 kHz mono f32)`);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
stdoutChunks.push(c);
|
|
109
|
+
});
|
|
110
|
+
proc.stderr.on("data", (c) => stderrChunks.push(c));
|
|
111
|
+
const timer = setTimeout(() => {
|
|
112
|
+
kill(`ffmpeg exceeded timeout of ${timeoutMs} ms`);
|
|
113
|
+
}, timeoutMs);
|
|
114
|
+
return new Promise((resolve, reject) => {
|
|
115
|
+
proc.on("error", (err) => {
|
|
116
|
+
clearTimeout(timer);
|
|
117
|
+
if (err.code === "ENOENT") {
|
|
118
|
+
reject(new FfmpegError(`ffmpeg not found on PATH. ${ffmpegInstallHint()}`));
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
reject(new FfmpegError(`failed to spawn ffmpeg: ${err.message}`));
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
proc.on("close", (code) => {
|
|
125
|
+
clearTimeout(timer);
|
|
126
|
+
if (killReason !== null) {
|
|
127
|
+
reject(new FfmpegError(killReason));
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (code !== 0) {
|
|
131
|
+
const stderr = Buffer.concat(stderrChunks).toString("utf8").trim();
|
|
132
|
+
reject(new FfmpegError(`ffmpeg exited with code ${code}: ${stderr}`));
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const buf = Buffer.concat(stdoutChunks);
|
|
136
|
+
if (buf.byteLength % 4 !== 0) {
|
|
137
|
+
reject(new FfmpegError(`ffmpeg produced ${buf.byteLength} bytes, not a multiple of 4`));
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
// Wrap the bytes as Float32 in one shot. This is ~100x faster than
|
|
141
|
+
// looping with buf.readFloatLE(i) and is host-endian-safe on every
|
|
142
|
+
// platform Node supports: V8 only ships on little-endian hosts (x86_64,
|
|
143
|
+
// arm64, riscv64 in LE mode), and the f32le ffmpeg output we asked for
|
|
144
|
+
// is also little-endian, so the two endiannesses match by construction.
|
|
145
|
+
// We allocate a fresh ArrayBuffer because (a) it's guaranteed 4-byte
|
|
146
|
+
// aligned, which Float32Array requires, and (b) Buffer.concat returns
|
|
147
|
+
// memory whose byteOffset may not be aligned.
|
|
148
|
+
const aligned = new ArrayBuffer(buf.byteLength);
|
|
149
|
+
new Uint8Array(aligned).set(buf);
|
|
150
|
+
const f32 = new Float32Array(aligned);
|
|
151
|
+
resolve(f32);
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WhisperModelInstance } from "./addon.js";
|
|
2
|
+
type CachedHandle = {
|
|
3
|
+
instance: WhisperModelInstance;
|
|
4
|
+
};
|
|
5
|
+
export declare const handleCache: Record<string, CachedHandle>;
|
|
6
|
+
export declare function acquireHandle(key: string, factory: () => WhisperModelInstance): WhisperModelInstance;
|
|
7
|
+
export declare function isCached(key: string): boolean;
|
|
8
|
+
export declare function _clearHandleCache(): void;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// Insertion-order map. Each call to acquireHandle() promotes the entry to
|
|
2
|
+
// most-recently-used. evictOldest() drops the least-recently-used entry.
|
|
3
|
+
export const handleCache = {};
|
|
4
|
+
// Default cap of 2 loaded models. A typical Agency program uses one model;
|
|
5
|
+
// two leaves headroom for "switching from base.en to large-v3 mid-program"
|
|
6
|
+
// without thrashing. Each entry can hold hundreds of MB (a large-v3 context
|
|
7
|
+
// is ~3 GB), so an unbounded cache is dangerous in long-lived processes.
|
|
8
|
+
//
|
|
9
|
+
// Override via AGENCY_WHISPER_HANDLE_CACHE_MAX. Set to 0 to disable caching
|
|
10
|
+
// (every transcribe() loads + frees), or to a large value to opt out of LRU.
|
|
11
|
+
function configuredMax() {
|
|
12
|
+
const raw = process.env.AGENCY_WHISPER_HANDLE_CACHE_MAX;
|
|
13
|
+
if (raw === undefined)
|
|
14
|
+
return 2;
|
|
15
|
+
const n = Number(raw);
|
|
16
|
+
if (!Number.isFinite(n) || n < 0)
|
|
17
|
+
return 2;
|
|
18
|
+
return Math.floor(n);
|
|
19
|
+
}
|
|
20
|
+
function freeQuiet(key, instance) {
|
|
21
|
+
try {
|
|
22
|
+
instance.free();
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
// free() throws "WhisperModel busy" if a transcribe is still in flight.
|
|
26
|
+
// The Persistent ref in the addon keeps the model alive until the worker
|
|
27
|
+
// finishes; we just drop our cache entry. Worst case we leak one model
|
|
28
|
+
// until its in-flight transcribe completes and JS GC collects it.
|
|
29
|
+
console.warn(`whisper-local: failed to free model "${key}": ${err.message}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// Touch an existing entry so it becomes most-recently-used. Implemented by
|
|
33
|
+
// delete + re-insert, which is O(1) on V8's hash map and preserves insertion
|
|
34
|
+
// order semantics for Object.keys().
|
|
35
|
+
function touch(key) {
|
|
36
|
+
const entry = handleCache[key];
|
|
37
|
+
if (entry === undefined)
|
|
38
|
+
return;
|
|
39
|
+
delete handleCache[key];
|
|
40
|
+
handleCache[key] = entry;
|
|
41
|
+
}
|
|
42
|
+
export function acquireHandle(key, factory) {
|
|
43
|
+
const existing = handleCache[key];
|
|
44
|
+
if (existing) {
|
|
45
|
+
touch(key);
|
|
46
|
+
return existing.instance;
|
|
47
|
+
}
|
|
48
|
+
const max = configuredMax();
|
|
49
|
+
// Failure-atomic: construct *first*, then evict + insert. If factory()
|
|
50
|
+
// throws (corrupt model, OOM, missing GPU, …) we leave the existing
|
|
51
|
+
// cache contents untouched. A transient load failure must not cost the
|
|
52
|
+
// user the model they already had loaded.
|
|
53
|
+
const instance = factory();
|
|
54
|
+
if (max === 0) {
|
|
55
|
+
// max=0 means "don't cache" — hand the instance back without storing.
|
|
56
|
+
// The caller is responsible for free() (transcribe.ts wraps this path
|
|
57
|
+
// so the model is freed after each call).
|
|
58
|
+
return instance;
|
|
59
|
+
}
|
|
60
|
+
// Evict from the front (least-recently-used) until we have room. We only
|
|
61
|
+
// need to evict 1 in steady state, but a runtime decrease in max via env
|
|
62
|
+
// re-read could leave the cache larger than max — handle it generally.
|
|
63
|
+
while (Object.keys(handleCache).length >= max) {
|
|
64
|
+
const oldestKey = Object.keys(handleCache)[0];
|
|
65
|
+
if (oldestKey === undefined)
|
|
66
|
+
break;
|
|
67
|
+
const oldest = handleCache[oldestKey];
|
|
68
|
+
delete handleCache[oldestKey];
|
|
69
|
+
freeQuiet(oldestKey, oldest.instance);
|
|
70
|
+
}
|
|
71
|
+
handleCache[key] = { instance };
|
|
72
|
+
return instance;
|
|
73
|
+
}
|
|
74
|
+
// Whether a given key is currently cached (test helper).
|
|
75
|
+
export function isCached(key) {
|
|
76
|
+
return handleCache[key] !== undefined;
|
|
77
|
+
}
|
|
78
|
+
export function _clearHandleCache() {
|
|
79
|
+
for (const key of Object.keys(handleCache)) {
|
|
80
|
+
freeQuiet(key, handleCache[key].instance);
|
|
81
|
+
delete handleCache[key];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ModelName, Lockfile, LockfileEntry } from "./types.js";
|
|
2
|
+
export declare class ModelManagerError extends Error {
|
|
3
|
+
constructor(message: string);
|
|
4
|
+
}
|
|
5
|
+
export declare function resolveModelDir(): string;
|
|
6
|
+
export declare function resolveModelPath(name: ModelName, dir?: string): string;
|
|
7
|
+
export declare function isModelInstalled(name: ModelName, dir?: string): Promise<boolean>;
|
|
8
|
+
export declare function parseLockfile(text: string, source?: string): Lockfile;
|
|
9
|
+
export declare function loadLockfile(): Promise<Lockfile>;
|
|
10
|
+
export declare function sha256OfFile(filepath: string): Promise<string>;
|
|
11
|
+
export declare function downloadModel(entry: LockfileEntry, dest: string): Promise<void>;
|
|
12
|
+
export declare function ensureModel(name: ModelName, dir?: string): Promise<string>;
|