Upload JointCTCAttentionEncoderDecoder
Browse files- modeling_reguler.py +3 -0
modeling_reguler.py
CHANGED
@@ -466,6 +466,9 @@ class JointCTCAttentionEncoderDecoder(SpeechEncoderDecoderModel):
|
|
466 |
) -> Union[GenerateOutput, torch.LongTensor]:
|
467 |
if "encoder_outputs" in kwargs:
|
468 |
self.encoder_logits = kwargs["encoder_outputs"].logits
|
|
|
|
|
|
|
469 |
output = super().generate(
|
470 |
inputs,
|
471 |
generation_config,
|
|
|
466 |
) -> Union[GenerateOutput, torch.LongTensor]:
|
467 |
if "encoder_outputs" in kwargs:
|
468 |
self.encoder_logits = kwargs["encoder_outputs"].logits
|
469 |
+
self.encoder_output_lens = self.encoder._get_feat_extract_output_lengths(
|
470 |
+
kwargs["attention_mask"].sum(dim=1)
|
471 |
+
)
|
472 |
output = super().generate(
|
473 |
inputs,
|
474 |
generation_config,
|