@@ -651,30 +651,33 @@ wasi_nn_load_by_name(wasm_exec_env_t exec_env, char *name, uint32_t name_len,
651651 continue ;
652652 }
653653 is_loaded = wasm_runtime_get_wasi_nn_global_ctx_loaded_i (
654- wasi_nn_global_ctx , model_idx );
654+ wasi_nn_global_ctx , model_idx );
655655 free (model_name );
656656
657- graph_encoding encoding = str2encoding (
658- wasm_runtime_get_wasi_nn_global_ctx_encoding_i (wasi_nn_global_ctx , model_idx ));
659- execution_target target = str2target (
660- wasm_runtime_get_wasi_nn_global_ctx_target_i (wasi_nn_global_ctx , model_idx ));
657+ graph_encoding encoding =
658+ str2encoding (wasm_runtime_get_wasi_nn_global_ctx_encoding_i (
659+ wasi_nn_global_ctx , model_idx ));
660+ execution_target target =
661+ str2target (wasm_runtime_get_wasi_nn_global_ctx_target_i (
662+ wasi_nn_global_ctx , model_idx ));
661663
662664 // res = ensure_backend(instance, autodetect, wasi_nn_ctx);
663665 res = ensure_backend (instance , encoding , wasi_nn_ctx );
664666 if (res != success )
665667 goto fail ;
666668
667669 if (!is_loaded && (model_idx < MAX_GLOBAL_GRAPHS_PER_INST )
668- && (model_idx < global_n_graphs )) {
669- NN_DBG_PRINTF ("Model is not yet loaded, will add to global context" );
670+ && (model_idx < global_n_graphs )) {
671+ NN_DBG_PRINTF (
672+ "Model is not yet loaded, will add to global context" );
670673 call_wasi_nn_func (wasi_nn_ctx -> backend , load_by_name , res ,
671- wasi_nn_ctx -> backend_ctx , global_model_path_i ,
672- strlen (global_model_path_i ), encoding , target , g );
674+ wasi_nn_ctx -> backend_ctx , global_model_path_i ,
675+ strlen (global_model_path_i ), encoding , target , g );
673676 if (res != success )
674677 goto fail ;
675678
676679 wasm_runtime_set_wasi_nn_global_ctx_loaded_i (wasi_nn_global_ctx ,
677- model_idx , 1 );
680+ model_idx , 1 );
678681 res = success ;
679682 break ;
680683 }
@@ -691,8 +694,8 @@ wasi_nn_load_by_name(wasm_exec_env_t exec_env, char *name, uint32_t name_len,
691694 }
692695 else if (model_idx >= global_n_graphs ) {
693696 NN_ERR_PRINTF ("Model %s is not loaded, you should pass its path "
694- "through --wasi-nn-graph" ,
695- nul_terminated_name );
697+ "through --wasi-nn-graph" ,
698+ nul_terminated_name );
696699 res = not_found ;
697700 }
698701fail :
0 commit comments