whisper.rn 0.2.5 → 0.3.0-rc.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/README.md +29 -4
- package/android/src/main/java/com/rnwhisper/RNWhisperModule.java +7 -2
- package/android/src/main/java/com/rnwhisper/WhisperContext.java +7 -6
- package/android/src/main/jni/whisper/jni.cpp +50 -5
- package/cpp/coreml/whisper-decoder-impl.h +146 -0
- package/cpp/coreml/whisper-decoder-impl.m +201 -0
- package/cpp/coreml/whisper-encoder-impl.h +142 -0
- package/cpp/coreml/whisper-encoder-impl.m +197 -0
- package/cpp/coreml/whisper-encoder.h +22 -0
- package/cpp/coreml/whisper-encoder.mm +63 -0
- package/cpp/ggml.c +6339 -1662
- package/cpp/ggml.h +741 -554
- package/cpp/rn-whisper.cpp +0 -23
- package/cpp/rn-whisper.h +0 -6
- package/cpp/whisper.cpp +928 -625
- package/cpp/whisper.h +26 -2
- package/ios/RNWhisper.mm +19 -1
- package/ios/RNWhisperContext.mm +1 -6
- package/lib/commonjs/index.js +12 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +9 -2
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +6 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/index.ts +9 -3
- package/whisper-rn.podspec +8 -2
package/cpp/rn-whisper.cpp
CHANGED
|
@@ -6,29 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
extern "C" {
|
|
8
8
|
|
|
9
|
-
void rn_whisper_convert_prompt(
|
|
10
|
-
struct whisper_context * ctx,
|
|
11
|
-
struct whisper_full_params params,
|
|
12
|
-
std::string * prompt
|
|
13
|
-
) {
|
|
14
|
-
std::vector<whisper_token> prompt_tokens;
|
|
15
|
-
if (!prompt->empty()) {
|
|
16
|
-
prompt_tokens.resize(1024);
|
|
17
|
-
prompt_tokens.resize(whisper_tokenize(ctx, prompt->c_str(), prompt_tokens.data(), prompt_tokens.size()));
|
|
18
|
-
|
|
19
|
-
// fprintf(stderr, "\n");
|
|
20
|
-
// fprintf(stderr, "initial prompt: '%s'\n", prompt->c_str());
|
|
21
|
-
// fprintf(stderr, "initial tokens: [ ");
|
|
22
|
-
// for (int i = 0; i < (int) prompt_tokens.size(); ++i) {
|
|
23
|
-
// fprintf(stderr, "%d ", prompt_tokens[i]);
|
|
24
|
-
// }
|
|
25
|
-
// fprintf(stderr, "]\n");
|
|
26
|
-
|
|
27
|
-
params.prompt_tokens = prompt_tokens.data();
|
|
28
|
-
params.prompt_n_tokens = prompt_tokens.size();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
9
|
std::unordered_map<int, bool> abort_map;
|
|
33
10
|
|
|
34
11
|
bool* rn_whisper_assign_abort_map(int job_id) {
|
package/cpp/rn-whisper.h
CHANGED
|
@@ -5,12 +5,6 @@
|
|
|
5
5
|
extern "C" {
|
|
6
6
|
#endif
|
|
7
7
|
|
|
8
|
-
void rn_whisper_convert_prompt(
|
|
9
|
-
struct whisper_context * ctx,
|
|
10
|
-
struct whisper_full_params params,
|
|
11
|
-
std::string * prompt
|
|
12
|
-
);
|
|
13
|
-
|
|
14
8
|
bool* rn_whisper_assign_abort_map(int job_id);
|
|
15
9
|
void rn_whisper_remove_abort_map(int job_id);
|
|
16
10
|
void rn_whisper_abort_transcribe(int job_id);
|