mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
Merge pull request #39 from alibaba-damo-academy/dev_lyb
fix ctc beamsearch
This commit is contained in:
commit
944c04721c
@ -169,7 +169,7 @@ class Speech2Text:
|
||||
self.converter = converter
|
||||
self.tokenizer = tokenizer
|
||||
is_use_lm = lm_weight != 0.0 and lm_file is not None
|
||||
if ctc_weight == 0.0 and not is_use_lm:
|
||||
if (ctc_weight == 0.0 or asr_model.ctc == None) and not is_use_lm:
|
||||
beam_search = None
|
||||
self.beam_search = beam_search
|
||||
logging.info(f"Beam_search: {self.beam_search}")
|
||||
|
||||
@ -172,7 +172,7 @@ class Speech2Text:
|
||||
self.converter = converter
|
||||
self.tokenizer = tokenizer
|
||||
is_use_lm = lm_weight != 0.0 and lm_file is not None
|
||||
if ctc_weight == 0.0 and not is_use_lm:
|
||||
if (ctc_weight == 0.0 or asr_model.ctc == None) and not is_use_lm:
|
||||
beam_search = None
|
||||
self.beam_search = beam_search
|
||||
logging.info(f"Beam_search: {self.beam_search}")
|
||||
|
||||
@ -174,7 +174,7 @@ class Speech2Text:
|
||||
self.converter = converter
|
||||
self.tokenizer = tokenizer
|
||||
is_use_lm = lm_weight != 0.0 and lm_file is not None
|
||||
if ctc_weight == 0.0 and not is_use_lm:
|
||||
if (ctc_weight == 0.0 or asr_model.ctc == None) and not is_use_lm:
|
||||
beam_search = None
|
||||
self.beam_search = beam_search
|
||||
logging.info(f"Beam_search: {self.beam_search}")
|
||||
@ -666,7 +666,7 @@ def inference_modelscope(
|
||||
time_stamp_postprocessed))
|
||||
|
||||
logging.info("decoding, feature length total: {}, forward_time total: {:.4f}, rtf avg: {:.4f}".
|
||||
format(length_total, forward_time_total, 100 * forward_time_total / (length_total * lfr_factor)))
|
||||
format(length_total, forward_time_total, 100 * forward_time_total / (length_total * lfr_factor+1e-6)))
|
||||
return asr_result_list
|
||||
return _forward
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user