support wav2vec2-zh cli, test=asr

pull/2697/head
tianhao zhang 3 years ago
parent bec16f8a07
commit 42d619163a

@ -25,7 +25,7 @@ import librosa
import numpy as np import numpy as np
import paddle import paddle
import soundfile import soundfile
import transformers from paddlenlp.transformers import AutoTokenizer
from yacs.config import CfgNode from yacs.config import CfgNode
from ..executor import BaseExecutor from ..executor import BaseExecutor
@ -185,7 +185,7 @@ class SSLExecutor(BaseExecutor):
unit_type=self.config.unit_type, unit_type=self.config.unit_type,
vocab=self.config.vocab_filepath) vocab=self.config.vocab_filepath)
elif lang == 'zh': elif lang == 'zh':
self.text_feature = transformers.BertTokenizer.from_pretrained( self.text_feature = AutoTokenizer.from_pretrained(
self.config.tokenizer) self.config.tokenizer)
self.config.decode.decoding_method = decode_method self.config.decode.decoding_method = decode_method
model_name = model_type[:model_type.rindex( model_name = model_type[:model_type.rindex(

Loading…
Cancel
Save