whisper.rn 0.4.0-rc.2 → 0.4.0-rc.4
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/android/src/main/CMakeLists.txt +2 -0
- package/android/src/main/java/com/rnwhisper/RNWhisper.java +6 -1
- package/android/src/main/java/com/rnwhisper/WhisperContext.java +29 -15
- package/android/src/main/jni.cpp +6 -2
- package/cpp/ggml-alloc.c +413 -280
- package/cpp/ggml-alloc.h +67 -8
- package/cpp/ggml-backend-impl.h +87 -0
- package/cpp/ggml-backend.c +950 -0
- package/cpp/ggml-backend.h +136 -0
- package/cpp/ggml-impl.h +243 -0
- package/cpp/{ggml-metal.metal → ggml-metal-whisper.metal} +591 -121
- package/cpp/ggml-metal.h +21 -0
- package/cpp/ggml-metal.m +623 -234
- package/cpp/ggml-quants.c +7377 -0
- package/cpp/ggml-quants.h +224 -0
- package/cpp/ggml.c +3773 -4455
- package/cpp/ggml.h +279 -146
- package/cpp/whisper.cpp +182 -103
- package/cpp/whisper.h +48 -11
- package/ios/RNWhisper.mm +8 -2
- package/ios/RNWhisperContext.h +6 -2
- package/ios/RNWhisperContext.mm +97 -26
- package/jest/mock.js +1 -1
- package/lib/commonjs/NativeRNWhisper.js.map +1 -1
- package/lib/commonjs/index.js +28 -9
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/NativeRNWhisper.js.map +1 -1
- package/lib/module/index.js +28 -9
- package/lib/module/index.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/NativeRNWhisper.d.ts +7 -1
- package/lib/typescript/NativeRNWhisper.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +8 -3
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/NativeRNWhisper.ts +8 -1
- package/src/index.ts +30 -18
- package/src/version.json +1 -1
- package/whisper-rn.podspec +1 -2
package/cpp/ggml-metal.h
CHANGED
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
|
|
20
20
|
#pragma once
|
|
21
21
|
|
|
22
|
+
#include "ggml.h"
|
|
23
|
+
#include "ggml-backend.h"
|
|
24
|
+
|
|
22
25
|
#include <stddef.h>
|
|
23
26
|
#include <stdbool.h>
|
|
24
27
|
|
|
@@ -33,8 +36,15 @@ struct wsp_ggml_cgraph;
|
|
|
33
36
|
extern "C" {
|
|
34
37
|
#endif
|
|
35
38
|
|
|
39
|
+
//
|
|
40
|
+
// internal API
|
|
41
|
+
// temporary exposed to user-code
|
|
42
|
+
//
|
|
43
|
+
|
|
36
44
|
struct wsp_ggml_metal_context;
|
|
37
45
|
|
|
46
|
+
void wsp_ggml_metal_log_set_callback(wsp_ggml_log_callback log_callback, void * user_data);
|
|
47
|
+
|
|
38
48
|
// number of command buffers to use
|
|
39
49
|
struct wsp_ggml_metal_context * wsp_ggml_metal_init(int n_cb);
|
|
40
50
|
void wsp_ggml_metal_free(struct wsp_ggml_metal_context * ctx);
|
|
@@ -79,6 +89,17 @@ int * wsp_ggml_metal_get_concur_list(struct wsp_ggml_metal_context * ctx);
|
|
|
79
89
|
// creates gf->n_threads command buffers in parallel
|
|
80
90
|
void wsp_ggml_metal_graph_compute(struct wsp_ggml_metal_context * ctx, struct wsp_ggml_cgraph * gf);
|
|
81
91
|
|
|
92
|
+
//
|
|
93
|
+
// backend API
|
|
94
|
+
// user-code should use only these functions
|
|
95
|
+
//
|
|
96
|
+
|
|
97
|
+
WSP_GGML_API wsp_ggml_backend_t wsp_ggml_backend_metal_init(void);
|
|
98
|
+
|
|
99
|
+
WSP_GGML_API bool wsp_ggml_backend_is_metal(wsp_ggml_backend_t backend);
|
|
100
|
+
|
|
101
|
+
WSP_GGML_API void wsp_ggml_backend_metal_set_n_cb(wsp_ggml_backend_t backend, int n_cb);
|
|
102
|
+
|
|
82
103
|
#ifdef __cplusplus
|
|
83
104
|
}
|
|
84
105
|
#endif
|