Commit ·
823f133
1
Parent(s): b4b0962
feat(clf): enable opt out of adapter
Browse files
modeling_seamless_m4t_v2_speech_encoder.py
CHANGED
|
@@ -74,7 +74,7 @@ class SeamlessM4Tv2ForAudioClassification(SeamlessM4Tv2PreTrainedModel):
|
|
| 74 |
**kwargs,
|
| 75 |
)
|
| 76 |
hidden_states = outputs.last_hidden_state
|
| 77 |
-
if attention_mask is not None:
|
| 78 |
sub_sampled_lengths = self._compute_sub_sample_lengths_from_attention_mask(
|
| 79 |
attention_mask
|
| 80 |
).to(outputs.last_hidden_state.device)
|
|
|
|
| 74 |
**kwargs,
|
| 75 |
)
|
| 76 |
hidden_states = outputs.last_hidden_state
|
| 77 |
+
if attention_mask is not None and self.model.config.add_adapter:
|
| 78 |
sub_sampled_lengths = self._compute_sub_sample_lengths_from_attention_mask(
|
| 79 |
attention_mask
|
| 80 |
).to(outputs.last_hidden_state.device)
|