@@ -660,61 +660,61 @@ func newCOfflineRecognizerConfig(config *OfflineRecognizerConfig) *C.struct_Sher
660660}
661661func freeCOfflineRecognizerConfig (c * C.struct_SherpaOnnxOfflineRecognizerConfig ) {
662662 stringFields := []* (* C.char ){
663- & c .model_config .transducer .encoder ,
664- & c .model_config .transducer .decoder ,
665- & c .model_config .transducer .joiner ,
666- & c .model_config .paraformer .model ,
667- & c .model_config .nemo_ctc .model ,
668- & c .model_config .whisper .encoder ,
669- & c .model_config .whisper .decoder ,
670- & c .model_config .whisper .language ,
671- & c .model_config .whisper .task ,
672- & c .model_config .tdnn .model ,
673- & c .model_config .sense_voice .model ,
674- & c .model_config .sense_voice .language ,
675- & c .model_config .moonshine .preprocessor ,
676- & c .model_config .moonshine .encoder ,
677- & c .model_config .moonshine .uncached_decoder ,
678- & c .model_config .moonshine .cached_decoder ,
679- & c .model_config .fire_red_asr .encoder ,
680- & c .model_config .fire_red_asr .decoder ,
681- & c .model_config .funasr_nano .encoder_adaptor ,
682- & c .model_config .funasr_nano .llm_prefill ,
683- & c .model_config .funasr_nano .llm_decode ,
684- & c .model_config .funasr_nano .embedding ,
685- & c .model_config .funasr_nano .tokenizer ,
686- & c .model_config .funasr_nano .system_prompt ,
687- & c .model_config .funasr_nano .user_prompt ,
688- & c .model_config .dolphin .model ,
689- & c .model_config .zipformer_ctc .model ,
690- & c .model_config .canary .encoder ,
691- & c .model_config .canary .decoder ,
692- & c .model_config .canary .src_lang ,
693- & c .model_config .canary .tgt_lang ,
694- & c .model_config .wenet_ctc .model ,
695- & c .model_config .medasr .model ,
696- & c .model_config .omnilingual .model ,
697- & c .model_config .tokens ,
698- & c .model_config .provider ,
699- & c .model_config .model_type ,
700- & c .model_config .modeling_unit ,
701- & c .model_config .bpe_vocab ,
702- & c .model_config .telespeech_ctc ,
703- & c .lm_config .model ,
704- & c .decoding_method ,
705- & c .hotwords_file ,
706- & c .rule_fsts ,
707- & c .rule_fars ,
708- & c .hr .lexicon ,
709- & c .hr .rule_fsts ,
710- }
711-
712- for _ , field := range stringFields {
713- if * field != nil {
714- C .free (unsafe .Pointer (* field ))
715- * field = nil
716- }
717- }
663+ & c .model_config .transducer .encoder ,
664+ & c .model_config .transducer .decoder ,
665+ & c .model_config .transducer .joiner ,
666+ & c .model_config .paraformer .model ,
667+ & c .model_config .nemo_ctc .model ,
668+ & c .model_config .whisper .encoder ,
669+ & c .model_config .whisper .decoder ,
670+ & c .model_config .whisper .language ,
671+ & c .model_config .whisper .task ,
672+ & c .model_config .tdnn .model ,
673+ & c .model_config .sense_voice .model ,
674+ & c .model_config .sense_voice .language ,
675+ & c .model_config .moonshine .preprocessor ,
676+ & c .model_config .moonshine .encoder ,
677+ & c .model_config .moonshine .uncached_decoder ,
678+ & c .model_config .moonshine .cached_decoder ,
679+ & c .model_config .fire_red_asr .encoder ,
680+ & c .model_config .fire_red_asr .decoder ,
681+ & c .model_config .funasr_nano .encoder_adaptor ,
682+ & c .model_config .funasr_nano .llm_prefill ,
683+ & c .model_config .funasr_nano .llm_decode ,
684+ & c .model_config .funasr_nano .embedding ,
685+ & c .model_config .funasr_nano .tokenizer ,
686+ & c .model_config .funasr_nano .system_prompt ,
687+ & c .model_config .funasr_nano .user_prompt ,
688+ & c .model_config .dolphin .model ,
689+ & c .model_config .zipformer_ctc .model ,
690+ & c .model_config .canary .encoder ,
691+ & c .model_config .canary .decoder ,
692+ & c .model_config .canary .src_lang ,
693+ & c .model_config .canary .tgt_lang ,
694+ & c .model_config .wenet_ctc .model ,
695+ & c .model_config .medasr .model ,
696+ & c .model_config .omnilingual .model ,
697+ & c .model_config .tokens ,
698+ & c .model_config .provider ,
699+ & c .model_config .model_type ,
700+ & c .model_config .modeling_unit ,
701+ & c .model_config .bpe_vocab ,
702+ & c .model_config .telespeech_ctc ,
703+ & c .lm_config .model ,
704+ & c .decoding_method ,
705+ & c .hotwords_file ,
706+ & c .rule_fsts ,
707+ & c .rule_fars ,
708+ & c .hr .lexicon ,
709+ & c .hr .rule_fsts ,
710+ }
711+
712+ for _ , field := range stringFields {
713+ if * field != nil {
714+ C .free (unsafe .Pointer (* field ))
715+ * field = nil
716+ }
717+ }
718718}
719719
720720// Frees the internal pointer of the recognition to avoid memory leak.
0 commit comments