@@ -3492,13 +3492,15 @@ struct whisper_state * whisper_init_state(whisper_context * ctx) {
34923492 return state;
34933493}
34943494
3495- int whisper_ctx_init_openvino_encoder (
3495+ int whisper_ctx_init_openvino_encoder_with_state (
34963496 struct whisper_context * ctx,
3497+ struct whisper_state * state,
34973498 const char * model_path,
34983499 const char * device,
34993500 const char * cache_dir) {
35003501#ifndef WHISPER_USE_OPENVINO
35013502 (void )(ctx);
3503+ (void )(state);
35023504 (void )(model_path);
35033505 (void )(device);
35043506 (void )(cache_dir);
@@ -3529,8 +3531,8 @@ int whisper_ctx_init_openvino_encoder(
35293531 WHISPER_LOG_INFO (" %s: loading OpenVINO model from '%s'\n " , __func__, path_encoder.c_str ());
35303532 WHISPER_LOG_INFO (" %s: first run on a device may take a while ...\n " , __func__);
35313533
3532- ctx-> state ->ctx_openvino = whisper_openvino_init (path_encoder.c_str (), device, path_cache.c_str ());
3533- if (!ctx-> state ->ctx_openvino ) {
3534+ state->ctx_openvino = whisper_openvino_init (path_encoder.c_str (), device, path_cache.c_str ());
3535+ if (!state->ctx_openvino ) {
35343536 WHISPER_LOG_ERROR (" %s: failed to init OpenVINO encoder from '%s'\n " , __func__, path_encoder.c_str ());
35353537 return 1 ;
35363538 } else {
@@ -3541,6 +3543,14 @@ int whisper_ctx_init_openvino_encoder(
35413543#endif
35423544}
35433545
3546+ int whisper_ctx_init_openvino_encoder (
3547+ struct whisper_context * ctx,
3548+ const char * model_path,
3549+ const char * device,
3550+ const char * cache_dir) {
3551+ return whisper_ctx_init_openvino_encoder_with_state (ctx, ctx->state , model_path, device, cache_dir);
3552+ }
3553+
35443554struct whisper_context_params whisper_context_default_params () {
35453555 struct whisper_context_params result = {
35463556 /* .use_gpu =*/ true ,
0 commit comments