mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
update repo
This commit is contained in:
parent
adb8997b80
commit
5feca0cc17
@ -239,6 +239,7 @@ def build_asr_model(args):
|
||||
vocab_size = len(token_list)
|
||||
logging.info(f"Vocabulary size: {vocab_size}")
|
||||
else:
|
||||
token_list = None
|
||||
vocab_size = None
|
||||
|
||||
# frontend
|
||||
@ -265,7 +266,10 @@ def build_asr_model(args):
|
||||
# normalization layer
|
||||
if args.normalize is not None:
|
||||
normalize_class = normalize_choices.get_class(args.normalize)
|
||||
normalize = normalize_class(**args.normalize_conf)
|
||||
if args.model == "mfcca":
|
||||
normalize = normalize_class(stats_file=args.cmvn_file,**args.normalize_conf)
|
||||
else:
|
||||
normalize = normalize_class(**args.normalize_conf)
|
||||
else:
|
||||
normalize = None
|
||||
|
||||
@ -300,7 +304,7 @@ def build_asr_model(args):
|
||||
**args.model_conf,
|
||||
)
|
||||
elif args.model in ["paraformer", "paraformer_online", "paraformer_bert", "bicif_paraformer",
|
||||
"contextual_paraformer"]:
|
||||
"contextual_paraformer", "neatcontextual_paraformer"]:
|
||||
# predictor
|
||||
predictor_class = predictor_choices.get_class(args.predictor)
|
||||
predictor = predictor_class(**args.predictor_conf)
|
||||
|
||||
@ -50,9 +50,7 @@ class UniASR(FunASRModel):
|
||||
frontend: Optional[AbsFrontend],
|
||||
specaug: Optional[AbsSpecAug],
|
||||
normalize: Optional[AbsNormalize],
|
||||
preencoder: Optional[AbsPreEncoder],
|
||||
encoder: AbsEncoder,
|
||||
postencoder: Optional[AbsPostEncoder],
|
||||
decoder: AbsDecoder,
|
||||
ctc: CTC,
|
||||
ctc_weight: float = 0.5,
|
||||
@ -80,6 +78,8 @@ class UniASR(FunASRModel):
|
||||
loss_weight_model1: float = 0.5,
|
||||
enable_maas_finetune: bool = False,
|
||||
freeze_encoder2: bool = False,
|
||||
preencoder: Optional[AbsPreEncoder] = None,
|
||||
postencoder: Optional[AbsPostEncoder] = None,
|
||||
encoder1_encoder2_joint_training: bool = True,
|
||||
):
|
||||
assert check_argument_types()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user