|
|
@@ -55,9 +55,7 @@ class Paraformer(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,
|
|
|
@@ -78,6 +76,8 @@ class Paraformer(FunASRModel):
|
|
|
predictor_bias: int = 0,
|
|
|
sampling_ratio: float = 0.2,
|
|
|
share_embedding: bool = False,
|
|
|
+ preencoder: Optional[AbsPreEncoder] = None,
|
|
|
+ postencoder: Optional[AbsPostEncoder] = None,
|
|
|
):
|
|
|
assert check_argument_types()
|
|
|
assert 0.0 <= ctc_weight <= 1.0, ctc_weight
|
|
|
@@ -732,9 +732,7 @@ class ParaformerBert(Paraformer):
|
|
|
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,
|
|
|
@@ -757,6 +755,8 @@ class ParaformerBert(Paraformer):
|
|
|
embeds_id: int = 2,
|
|
|
embeds_loss_weight: float = 0.0,
|
|
|
embed_dims: int = 768,
|
|
|
+ preencoder: Optional[AbsPreEncoder] = None,
|
|
|
+ postencoder: Optional[AbsPostEncoder] = None,
|
|
|
):
|
|
|
assert check_argument_types()
|
|
|
assert 0.0 <= ctc_weight <= 1.0, ctc_weight
|
|
|
@@ -1008,9 +1008,7 @@ class BiCifParaformer(Paraformer):
|
|
|
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,
|
|
|
@@ -1030,6 +1028,8 @@ class BiCifParaformer(Paraformer):
|
|
|
predictor_weight: float = 0.0,
|
|
|
predictor_bias: int = 0,
|
|
|
sampling_ratio: float = 0.2,
|
|
|
+ preencoder: Optional[AbsPreEncoder] = None,
|
|
|
+ postencoder: Optional[AbsPostEncoder] = None,
|
|
|
):
|
|
|
assert check_argument_types()
|
|
|
assert 0.0 <= ctc_weight <= 1.0, ctc_weight
|
|
|
@@ -1277,9 +1277,7 @@ class ContextualParaformer(Paraformer):
|
|
|
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,
|
|
|
@@ -1309,6 +1307,8 @@ class ContextualParaformer(Paraformer):
|
|
|
bias_encoder_type: str = 'lstm',
|
|
|
label_bracket: bool = False,
|
|
|
use_decoder_embedding: bool = False,
|
|
|
+ preencoder: Optional[AbsPreEncoder] = None,
|
|
|
+ postencoder: Optional[AbsPostEncoder] = None,
|
|
|
):
|
|
|
assert check_argument_types()
|
|
|
assert 0.0 <= ctc_weight <= 1.0, ctc_weight
|