diff --git a/android/src/main/jni.cpp b/android/src/main/jni.cpp index 8fdc41e..8e2f013 100644 --- a/android/src/main/jni.cpp +++ b/android/src/main/jni.cpp @@ -155,6 +155,8 @@ Java_com_rnwhisper_WhisperContext_initContext( JNIEnv *env, jobject thiz, jstring model_path_str) { UNUSED(thiz); struct whisper_context_params cparams; + cparams.dtw_token_timestamps = false; + struct whisper_context *context = nullptr; const char *model_path_chars = env->GetStringUTFChars(model_path_str, nullptr); context = whisper_init_from_file_with_params(model_path_chars, cparams); @@ -171,6 +173,8 @@ Java_com_rnwhisper_WhisperContext_initContextWithAsset( ) { UNUSED(thiz); struct whisper_context_params cparams; + cparams.dtw_token_timestamps = false; + struct whisper_context *context = nullptr; const char *model_path_chars = env->GetStringUTFChars(model_path_str, nullptr); context = whisper_init_from_asset(env, asset_manager, model_path_chars, cparams); @@ -186,6 +190,8 @@ Java_com_rnwhisper_WhisperContext_initContextWithInputStream( ) { UNUSED(thiz); struct whisper_context_params cparams; + cparams.dtw_token_timestamps = false; + struct whisper_context *context = nullptr; context = whisper_init_from_input_stream(env, input_stream, cparams); return reinterpret_cast(context); diff --git a/ios/RNWhisperContext.mm b/ios/RNWhisperContext.mm index df30430..5b12c7e 100644 --- a/ios/RNWhisperContext.mm +++ b/ios/RNWhisperContext.mm @@ -19,6 +19,9 @@ + (instancetype)initWithModelPath:(NSString *)modelPath cparams.use_gpu = !noMetal; cparams.flash_attn = useFlashAttn; + // TODO: Figure out why it leads to re-init crash + cparams.dtw_token_timestamps = false; + cparams.use_coreml = !noCoreML; #ifndef WHISPER_USE_COREML if (cparams.use_coreml) {