mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
add BiCifParaformer
This commit is contained in:
parent
16d4e00549
commit
ad0039596c
@ -41,6 +41,7 @@ from funasr.models.frontend.wav_frontend import WavFrontend
|
|||||||
from funasr.tasks.vad import VADTask
|
from funasr.tasks.vad import VADTask
|
||||||
from funasr.utils.timestamp_tools import time_stamp_lfr6, time_stamp_lfr6_pl
|
from funasr.utils.timestamp_tools import time_stamp_lfr6, time_stamp_lfr6_pl
|
||||||
from funasr.bin.punctuation_infer import Text2Punc
|
from funasr.bin.punctuation_infer import Text2Punc
|
||||||
|
from funasr.models.e2e_asr_paraformer import BiCifParaformer
|
||||||
|
|
||||||
header_colors = '\033[95m'
|
header_colors = '\033[95m'
|
||||||
end_colors = '\033[0m'
|
end_colors = '\033[0m'
|
||||||
|
|||||||
@ -929,8 +929,6 @@ class BiCifParaformer(Paraformer):
|
|||||||
ds_alphas, ds_cif_peak, us_alphas, us_cif_peak = self.predictor.get_upsample_timestamp(encoder_out,
|
ds_alphas, ds_cif_peak, us_alphas, us_cif_peak = self.predictor.get_upsample_timestamp(encoder_out,
|
||||||
encoder_out_mask,
|
encoder_out_mask,
|
||||||
token_num)
|
token_num)
|
||||||
|
|
||||||
import pdb; pdb.set_trace()
|
|
||||||
return ds_alphas, ds_cif_peak, us_alphas, us_cif_peak
|
return ds_alphas, ds_cif_peak, us_alphas, us_cif_peak
|
||||||
|
|
||||||
def forward(
|
def forward(
|
||||||
|
|||||||
@ -128,7 +128,6 @@ def time_stamp_lfr6_pl(us_alphas, us_cif_peak, char_list, begin_time=0.0, end_ti
|
|||||||
res_txt = ""
|
res_txt = ""
|
||||||
for char, timestamp in zip(char_list, timestamp_list):
|
for char, timestamp in zip(char_list, timestamp_list):
|
||||||
res_txt += "{} {} {};".format(char, timestamp[0], timestamp[1])
|
res_txt += "{} {} {};".format(char, timestamp[0], timestamp[1])
|
||||||
logging.warning(res_txt) # for test
|
|
||||||
res = []
|
res = []
|
||||||
for char, timestamp in zip(char_list, timestamp_list):
|
for char, timestamp in zip(char_list, timestamp_list):
|
||||||
if char != '<sil>':
|
if char != '<sil>':
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user