Skip to content

Commit

Permalink
feat: sync whisper.cpp and enable metal on ios (#154)
Browse files Browse the repository at this point in the history
* feat: sync whisper.cpp and update patches

* feat(ios): enable metal

* fix(android): build

* fix: tests

* fix(ios): update ggml-metal patch

* fix(ios): force disable coreml when metal enabled

* feat(example): update options

* fix: tests

* feat: sync whisper.cpp

* feat(ts): update useGpu option doc

* chore: apply patches

* feat(ios, example): update RNWHISPER_DISABLE_METAL usage

* feat: sync whisper.cpp
  • Loading branch information
jhen0409 authored Nov 7, 2023
1 parent d45e235 commit aa2effb
Show file tree
Hide file tree
Showing 38 changed files with 14,925 additions and 5,169 deletions.
2 changes: 2 additions & 0 deletions android/src/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ set(
SOURCE_FILES
${RNWHISPER_LIB_DIR}/ggml.c
${RNWHISPER_LIB_DIR}/ggml-alloc.c
${RNWHISPER_LIB_DIR}/ggml-backend.c
${RNWHISPER_LIB_DIR}/ggml-quants.c
${RNWHISPER_LIB_DIR}/whisper.cpp
${RNWHISPER_LIB_DIR}/rn-whisper.cpp
${CMAKE_SOURCE_DIR}/jni.cpp
Expand Down
7 changes: 6 additions & 1 deletion android/src/main/java/com/rnwhisper/RNWhisper.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.facebook.react.bridge.LifecycleEventListener;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.bridge.Arguments;

import java.util.HashMap;
import java.util.Random;
Expand Down Expand Up @@ -107,7 +108,11 @@ protected void onPostExecute(Integer id) {
promise.reject(exception);
return;
}
promise.resolve(id);
WritableMap result = Arguments.createMap();
result.putInt("contextId", id);
result.putBoolean("gpu", false);
result.putString("reasonNoGPU", "Currently not supported");
promise.resolve(result);
tasks.remove(this);
}
}.execute();
Expand Down
Loading

0 comments on commit aa2effb

Please sign in to comment.