FunASR icon indicating copy to clipboard operation
FunASR copied to clipboard

AssertionError: EParaformer is not registered

Open Meeny2018 opened this issue 11 months ago • 2 comments

训练e-paraformer的时候报错“AssertionError: EParaformer is not registered”,进一步寻找发现e_paraformer的model.py “from funasr.models.transformer.utils.add_sos_eos import add_sos_eos, add_sos_and_eos” 导入错误,是由于funasr.models.transformer.utils.add_sos_eos 下面没有add_sos_and_eos这个函数。

Meeny2018 avatar Feb 21 '25 04:02 Meeny2018

可以参考添加add_sos_and_eos函数:

def add_sos_and_eos(ys_pad, sos, eos, ignore_id):

_sos = ys_pad.new([sos])
_eos = ys_pad.new([eos])
sequences = [y[y != ignore_id] for y in ys_pad]

ys_in = [torch.cat([_sos, seq, _eos], dim=0) for seq in sequences]
ys_out = [torch.cat([_sos, seq, _eos], dim=0) for seq in sequences]

return pad_list(ys_in, eos), pad_list(ys_out, ignore_id)

Qiang-Z avatar Mar 20 '25 07:03 Qiang-Z

多谢,不知道在librispeech复现的时候,英文有没有更好的提升

Meeny2018 avatar Mar 25 '25 04:03 Meeny2018