whisper.rn 0.4.2 → 0.5.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -3
- package/android/build.gradle +70 -11
- package/android/src/main/CMakeLists.txt +28 -1
- package/android/src/main/java/com/rnwhisper/JSCallInvokerResolver.java +40 -0
- package/android/src/main/java/com/rnwhisper/RNWhisper.java +80 -27
- package/android/src/main/java/com/rnwhisper/WhisperContext.java +21 -9
- package/android/src/main/java/com/rnwhisper/WhisperVadContext.java +1 -1
- package/android/src/main/jni.cpp +79 -2
- package/android/src/main/jniLibs/arm64-v8a/librnwhisper.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/librnwhisper_v8fp16_va_2.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/librnwhisper.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/librnwhisper_vfpv4.so +0 -0
- package/android/src/main/jniLibs/x86_64/librnwhisper.so +0 -0
- package/android/src/main/jniLibs/x86_64/librnwhisper_x86_64.so +0 -0
- package/android/src/newarch/java/com/rnwhisper/RNWhisperModule.java +5 -0
- package/android/src/oldarch/java/com/rnwhisper/RNWhisperModule.java +5 -0
- package/cpp/ggml-backend.cpp +36 -18
- package/cpp/ggml-backend.h +1 -1
- package/cpp/ggml-cpu/amx/mmq.cpp +10 -9
- package/cpp/ggml-cpu/arch/arm/quants.c +109 -108
- package/cpp/ggml-cpu/arch/arm/repack.cpp +13 -12
- package/cpp/ggml-cpu/arch/x86/quants.c +83 -82
- package/cpp/ggml-cpu/arch/x86/repack.cpp +20 -19
- package/cpp/ggml-cpu/common.h +3 -2
- package/cpp/ggml-cpu/ggml-cpu-impl.h +9 -3
- package/cpp/ggml-cpu/ggml-cpu.c +95 -17
- package/cpp/ggml-cpu/ggml-cpu.cpp +4 -0
- package/cpp/ggml-cpu/ops.cpp +775 -74
- package/cpp/ggml-cpu/ops.h +7 -0
- package/cpp/ggml-cpu/quants.c +25 -24
- package/cpp/ggml-cpu/repack.cpp +15 -14
- package/cpp/ggml-cpu/simd-mappings.h +211 -33
- package/cpp/ggml-cpu/vec.cpp +26 -2
- package/cpp/ggml-cpu/vec.h +99 -45
- package/cpp/ggml-cpu.h +2 -0
- package/cpp/ggml-impl.h +125 -183
- package/cpp/ggml-metal-impl.h +27 -0
- package/cpp/ggml-metal.m +298 -41
- package/cpp/ggml-quants.c +6 -6
- package/cpp/ggml-whisper-sim.metallib +0 -0
- package/cpp/ggml-whisper.metallib +0 -0
- package/cpp/ggml.c +269 -40
- package/cpp/ggml.h +122 -2
- package/cpp/gguf.cpp +5 -1
- package/cpp/jsi/RNWhisperJSI.cpp +681 -0
- package/cpp/jsi/RNWhisperJSI.h +44 -0
- package/cpp/jsi/ThreadPool.h +100 -0
- package/cpp/whisper.cpp +4 -0
- package/cpp/whisper.h +2 -0
- package/ios/RNWhisper.h +3 -0
- package/ios/RNWhisper.mm +66 -31
- package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/Headers/ggml-backend.h +1 -1
- package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/Headers/ggml-cpu.h +2 -0
- package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/Headers/ggml-impl.h +125 -183
- package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/Headers/ggml-metal-impl.h +27 -0
- package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/Headers/ggml.h +122 -2
- package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/Headers/whisper.h +2 -0
- package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/ggml-whisper.metallib +0 -0
- package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/rnwhisper +0 -0
- package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-backend.h +1 -1
- package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-cpu.h +2 -0
- package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-impl.h +125 -183
- package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-metal-impl.h +27 -0
- package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml.h +122 -2
- package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/Headers/whisper.h +2 -0
- package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/ggml-whisper-sim.metallib +0 -0
- package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/rnwhisper +0 -0
- package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/Headers/ggml-backend.h +1 -1
- package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/Headers/ggml-cpu.h +2 -0
- package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/Headers/ggml-impl.h +125 -183
- package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/Headers/ggml-metal-impl.h +27 -0
- package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/Headers/ggml.h +122 -2
- package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/Headers/whisper.h +2 -0
- package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/ggml-whisper.metallib +0 -0
- package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/rnwhisper +0 -0
- package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-backend.h +1 -1
- package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-cpu.h +2 -0
- package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-impl.h +125 -183
- package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-metal-impl.h +27 -0
- package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml.h +122 -2
- package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/Headers/whisper.h +2 -0
- package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/ggml-whisper-sim.metallib +0 -0
- package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/rnwhisper +0 -0
- package/jest/mock.js +1 -0
- package/lib/commonjs/NativeRNWhisper.js.map +1 -1
- package/lib/commonjs/index.js +83 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/NativeRNWhisper.js.map +1 -1
- package/lib/module/index.js +83 -2
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/NativeRNWhisper.d.ts +4 -0
- package/lib/typescript/NativeRNWhisper.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +18 -6
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +2 -3
- package/src/NativeRNWhisper.ts +2 -0
- package/src/index.ts +162 -33
- package/whisper-rn.podspec +6 -3
package/cpp/ggml.h
CHANGED
|
@@ -470,6 +470,7 @@ extern "C" {
|
|
|
470
470
|
WSP_GGML_OP_TRANSPOSE,
|
|
471
471
|
WSP_GGML_OP_GET_ROWS,
|
|
472
472
|
WSP_GGML_OP_GET_ROWS_BACK,
|
|
473
|
+
WSP_GGML_OP_SET_ROWS,
|
|
473
474
|
WSP_GGML_OP_DIAG,
|
|
474
475
|
WSP_GGML_OP_DIAG_MASK_INF,
|
|
475
476
|
WSP_GGML_OP_DIAG_MASK_ZERO,
|
|
@@ -481,6 +482,7 @@ extern "C" {
|
|
|
481
482
|
WSP_GGML_OP_CONV_TRANSPOSE_1D,
|
|
482
483
|
WSP_GGML_OP_IM2COL,
|
|
483
484
|
WSP_GGML_OP_IM2COL_BACK,
|
|
485
|
+
WSP_GGML_OP_CONV_2D,
|
|
484
486
|
WSP_GGML_OP_CONV_2D_DW,
|
|
485
487
|
WSP_GGML_OP_CONV_TRANSPOSE_2D,
|
|
486
488
|
WSP_GGML_OP_POOL_1D,
|
|
@@ -519,6 +521,8 @@ extern "C" {
|
|
|
519
521
|
WSP_GGML_OP_CROSS_ENTROPY_LOSS_BACK,
|
|
520
522
|
WSP_GGML_OP_OPT_STEP_ADAMW,
|
|
521
523
|
|
|
524
|
+
WSP_GGML_OP_GLU,
|
|
525
|
+
|
|
522
526
|
WSP_GGML_OP_COUNT,
|
|
523
527
|
};
|
|
524
528
|
|
|
@@ -542,6 +546,14 @@ extern "C" {
|
|
|
542
546
|
WSP_GGML_UNARY_OP_COUNT,
|
|
543
547
|
};
|
|
544
548
|
|
|
549
|
+
enum wsp_ggml_glu_op {
|
|
550
|
+
WSP_GGML_GLU_OP_REGLU,
|
|
551
|
+
WSP_GGML_GLU_OP_GEGLU,
|
|
552
|
+
WSP_GGML_GLU_OP_SWIGLU,
|
|
553
|
+
|
|
554
|
+
WSP_GGML_GLU_OP_COUNT,
|
|
555
|
+
};
|
|
556
|
+
|
|
545
557
|
enum wsp_ggml_object_type {
|
|
546
558
|
WSP_GGML_OBJECT_TYPE_TENSOR,
|
|
547
559
|
WSP_GGML_OBJECT_TYPE_GRAPH,
|
|
@@ -657,6 +669,7 @@ extern "C" {
|
|
|
657
669
|
WSP_GGML_API const char * wsp_ggml_op_symbol(enum wsp_ggml_op op);
|
|
658
670
|
|
|
659
671
|
WSP_GGML_API const char * wsp_ggml_unary_op_name(enum wsp_ggml_unary_op op);
|
|
672
|
+
WSP_GGML_API const char * wsp_ggml_glu_op_name(enum wsp_ggml_glu_op op);
|
|
660
673
|
WSP_GGML_API const char * wsp_ggml_op_desc(const struct wsp_ggml_tensor * t); // unary or op name
|
|
661
674
|
|
|
662
675
|
WSP_GGML_API size_t wsp_ggml_element_size(const struct wsp_ggml_tensor * tensor);
|
|
@@ -687,6 +700,9 @@ extern "C" {
|
|
|
687
700
|
// true for tensor that is stored in memory as CxWxHxN and has been permuted to WxHxCxN
|
|
688
701
|
WSP_GGML_API bool wsp_ggml_is_contiguous_channels(const struct wsp_ggml_tensor * tensor);
|
|
689
702
|
|
|
703
|
+
// true if the elements in dimension 0 are contiguous, or there is just 1 block of elements
|
|
704
|
+
WSP_GGML_API bool wsp_ggml_is_contiguous_rows(const struct wsp_ggml_tensor * tensor);
|
|
705
|
+
|
|
690
706
|
WSP_GGML_API bool wsp_ggml_are_same_shape (const struct wsp_ggml_tensor * t0, const struct wsp_ggml_tensor * t1);
|
|
691
707
|
WSP_GGML_API bool wsp_ggml_are_same_stride(const struct wsp_ggml_tensor * t0, const struct wsp_ggml_tensor * t1);
|
|
692
708
|
|
|
@@ -758,6 +774,7 @@ extern "C" {
|
|
|
758
774
|
WSP_GGML_API void wsp_ggml_unravel_index(const struct wsp_ggml_tensor * tensor, int64_t i, int64_t * i0, int64_t * i1, int64_t * i2, int64_t * i3);
|
|
759
775
|
|
|
760
776
|
WSP_GGML_API enum wsp_ggml_unary_op wsp_ggml_get_unary_op(const struct wsp_ggml_tensor * tensor);
|
|
777
|
+
WSP_GGML_API enum wsp_ggml_glu_op wsp_ggml_get_glu_op(const struct wsp_ggml_tensor * tensor);
|
|
761
778
|
|
|
762
779
|
WSP_GGML_API void * wsp_ggml_get_data (const struct wsp_ggml_tensor * tensor);
|
|
763
780
|
WSP_GGML_API float * wsp_ggml_get_data_f32(const struct wsp_ggml_tensor * tensor);
|
|
@@ -1086,6 +1103,63 @@ extern "C" {
|
|
|
1086
1103
|
struct wsp_ggml_context * ctx,
|
|
1087
1104
|
struct wsp_ggml_tensor * a);
|
|
1088
1105
|
|
|
1106
|
+
// gated linear unit ops
|
|
1107
|
+
// A: n columns, r rows,
|
|
1108
|
+
// result is n / 2 columns, r rows,
|
|
1109
|
+
// expects gate in second half of row, unless swapped is true
|
|
1110
|
+
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_glu(
|
|
1111
|
+
struct wsp_ggml_context * ctx,
|
|
1112
|
+
struct wsp_ggml_tensor * a,
|
|
1113
|
+
enum wsp_ggml_glu_op op,
|
|
1114
|
+
bool swapped);
|
|
1115
|
+
|
|
1116
|
+
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_reglu(
|
|
1117
|
+
struct wsp_ggml_context * ctx,
|
|
1118
|
+
struct wsp_ggml_tensor * a);
|
|
1119
|
+
|
|
1120
|
+
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_reglu_swapped(
|
|
1121
|
+
struct wsp_ggml_context * ctx,
|
|
1122
|
+
struct wsp_ggml_tensor * a);
|
|
1123
|
+
|
|
1124
|
+
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_geglu(
|
|
1125
|
+
struct wsp_ggml_context * ctx,
|
|
1126
|
+
struct wsp_ggml_tensor * a);
|
|
1127
|
+
|
|
1128
|
+
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_geglu_swapped(
|
|
1129
|
+
struct wsp_ggml_context * ctx,
|
|
1130
|
+
struct wsp_ggml_tensor * a);
|
|
1131
|
+
|
|
1132
|
+
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_swiglu(
|
|
1133
|
+
struct wsp_ggml_context * ctx,
|
|
1134
|
+
struct wsp_ggml_tensor * a);
|
|
1135
|
+
|
|
1136
|
+
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_swiglu_swapped(
|
|
1137
|
+
struct wsp_ggml_context * ctx,
|
|
1138
|
+
struct wsp_ggml_tensor * a);
|
|
1139
|
+
|
|
1140
|
+
// A: n columns, r rows,
|
|
1141
|
+
// B: n columns, r rows,
|
|
1142
|
+
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_glu_split(
|
|
1143
|
+
struct wsp_ggml_context * ctx,
|
|
1144
|
+
struct wsp_ggml_tensor * a,
|
|
1145
|
+
struct wsp_ggml_tensor * b,
|
|
1146
|
+
enum wsp_ggml_glu_op op);
|
|
1147
|
+
|
|
1148
|
+
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_reglu_split(
|
|
1149
|
+
struct wsp_ggml_context * ctx,
|
|
1150
|
+
struct wsp_ggml_tensor * a,
|
|
1151
|
+
struct wsp_ggml_tensor * b);
|
|
1152
|
+
|
|
1153
|
+
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_geglu_split(
|
|
1154
|
+
struct wsp_ggml_context * ctx,
|
|
1155
|
+
struct wsp_ggml_tensor * a,
|
|
1156
|
+
struct wsp_ggml_tensor * b);
|
|
1157
|
+
|
|
1158
|
+
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_swiglu_split(
|
|
1159
|
+
struct wsp_ggml_context * ctx,
|
|
1160
|
+
struct wsp_ggml_tensor * a,
|
|
1161
|
+
struct wsp_ggml_tensor * b);
|
|
1162
|
+
|
|
1089
1163
|
// normalize along rows
|
|
1090
1164
|
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_norm(
|
|
1091
1165
|
struct wsp_ggml_context * ctx,
|
|
@@ -1375,6 +1449,23 @@ extern "C" {
|
|
|
1375
1449
|
struct wsp_ggml_tensor * b, // row indices
|
|
1376
1450
|
struct wsp_ggml_tensor * c); // data for wsp_ggml_get_rows, only used for its shape
|
|
1377
1451
|
|
|
1452
|
+
// a TD [n_embd, ne1, ne2, ne3]
|
|
1453
|
+
// b TS [n_embd, n_rows, ne02, ne03] | ne02 == ne2, ne03 == ne3
|
|
1454
|
+
// c I64 [n_rows, ne11, ne12, 1] | c[i] in [0, ne1)
|
|
1455
|
+
//
|
|
1456
|
+
// undefined behavior if destination rows overlap
|
|
1457
|
+
//
|
|
1458
|
+
// broadcast:
|
|
1459
|
+
// ne2 % ne11 == 0
|
|
1460
|
+
// ne3 % ne12 == 0
|
|
1461
|
+
//
|
|
1462
|
+
// return view(a)
|
|
1463
|
+
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_set_rows(
|
|
1464
|
+
struct wsp_ggml_context * ctx,
|
|
1465
|
+
struct wsp_ggml_tensor * a, // destination
|
|
1466
|
+
struct wsp_ggml_tensor * b, // source
|
|
1467
|
+
struct wsp_ggml_tensor * c); // row indices
|
|
1468
|
+
|
|
1378
1469
|
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_diag(
|
|
1379
1470
|
struct wsp_ggml_context * ctx,
|
|
1380
1471
|
struct wsp_ggml_tensor * a);
|
|
@@ -1723,6 +1814,17 @@ extern "C" {
|
|
|
1723
1814
|
struct wsp_ggml_tensor * b,
|
|
1724
1815
|
int stride);
|
|
1725
1816
|
|
|
1817
|
+
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_conv_2d_direct(
|
|
1818
|
+
struct wsp_ggml_context * ctx,
|
|
1819
|
+
struct wsp_ggml_tensor * a, // convolution kernel [KW, KH, IC, OC]
|
|
1820
|
+
struct wsp_ggml_tensor * b, // input data [W, H, C, N]
|
|
1821
|
+
int s0, // stride dimension 0
|
|
1822
|
+
int s1, // stride dimension 1
|
|
1823
|
+
int p0, // padding dimension 0
|
|
1824
|
+
int p1, // padding dimension 1
|
|
1825
|
+
int d0, // dilation dimension 0
|
|
1826
|
+
int d1); // dilation dimension 1
|
|
1827
|
+
|
|
1726
1828
|
enum wsp_ggml_op_pool {
|
|
1727
1829
|
WSP_GGML_OP_POOL_MAX,
|
|
1728
1830
|
WSP_GGML_OP_POOL_AVG,
|
|
@@ -1765,6 +1867,12 @@ extern "C" {
|
|
|
1765
1867
|
enum wsp_ggml_scale_mode {
|
|
1766
1868
|
WSP_GGML_SCALE_MODE_NEAREST = 0,
|
|
1767
1869
|
WSP_GGML_SCALE_MODE_BILINEAR = 1,
|
|
1870
|
+
|
|
1871
|
+
WSP_GGML_SCALE_MODE_COUNT
|
|
1872
|
+
};
|
|
1873
|
+
|
|
1874
|
+
enum wsp_ggml_scale_flag {
|
|
1875
|
+
WSP_GGML_SCALE_FLAG_ALIGN_CORNERS = (1 << 8)
|
|
1768
1876
|
};
|
|
1769
1877
|
|
|
1770
1878
|
// interpolate
|
|
@@ -1777,14 +1885,26 @@ extern "C" {
|
|
|
1777
1885
|
|
|
1778
1886
|
// interpolate
|
|
1779
1887
|
// interpolate scale to specified dimensions
|
|
1780
|
-
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_upscale_ext(
|
|
1888
|
+
WSP_GGML_DEPRECATED(WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_upscale_ext(
|
|
1781
1889
|
struct wsp_ggml_context * ctx,
|
|
1782
1890
|
struct wsp_ggml_tensor * a,
|
|
1783
1891
|
int ne0,
|
|
1784
1892
|
int ne1,
|
|
1785
1893
|
int ne2,
|
|
1786
1894
|
int ne3,
|
|
1787
|
-
enum wsp_ggml_scale_mode mode)
|
|
1895
|
+
enum wsp_ggml_scale_mode mode),
|
|
1896
|
+
"use wsp_ggml_interpolate instead");
|
|
1897
|
+
|
|
1898
|
+
// Up- or downsamples the input to the specified size.
|
|
1899
|
+
// 2D scale modes (eg. bilinear) are applied to the first two dimensions.
|
|
1900
|
+
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_interpolate(
|
|
1901
|
+
struct wsp_ggml_context * ctx,
|
|
1902
|
+
struct wsp_ggml_tensor * a,
|
|
1903
|
+
int64_t ne0,
|
|
1904
|
+
int64_t ne1,
|
|
1905
|
+
int64_t ne2,
|
|
1906
|
+
int64_t ne3,
|
|
1907
|
+
uint32_t mode); // wsp_ggml_scale_mode [ | wsp_ggml_scale_flag...]
|
|
1788
1908
|
|
|
1789
1909
|
// pad each dimension with zeros: [x, ..., x] -> [x, ..., x, 0, ..., 0]
|
|
1790
1910
|
WSP_GGML_API struct wsp_ggml_tensor * wsp_ggml_pad(
|
package/cpp/gguf.cpp
CHANGED
|
@@ -335,7 +335,11 @@ struct wsp_gguf_context * wsp_gguf_init_from_file_impl(FILE * file, struct wsp_g
|
|
|
335
335
|
|
|
336
336
|
for (uint32_t i = 0; i < magic.size(); i++) {
|
|
337
337
|
if (magic[i] != WSP_GGUF_MAGIC[i]) {
|
|
338
|
-
|
|
338
|
+
char c0 = isprint(magic[0]) ? magic[0] : '?';
|
|
339
|
+
char c1 = isprint(magic[1]) ? magic[1] : '?';
|
|
340
|
+
char c2 = isprint(magic[2]) ? magic[2] : '?';
|
|
341
|
+
char c3 = isprint(magic[3]) ? magic[3] : '?';
|
|
342
|
+
WSP_GGML_LOG_ERROR("%s: invalid magic characters: '%c%c%c%c', expected 'GGUF'\n", __func__, c0, c1, c2, c3);
|
|
339
343
|
wsp_gguf_free(ctx);
|
|
340
344
|
return nullptr;
|
|
341
345
|
}
|