Skip to content

Commit f2738ee

Browse files
authored
fix tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest (#42272)
fix tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest failure Signed-off-by: Wang, Yi <[email protected]>
1 parent decde58 commit f2738ee

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/transformers/models/xcodec/modeling_xcodec.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,9 @@ def __init__(self, config):
403403
super().__init__(config)
404404
self.config = config
405405
self.pad = config.hop_length // 2
406-
self.acoustic_model = AutoModel.from_config(config.acoustic_model_config)
407-
406+
acoustic_model = AutoModel.from_config(config.acoustic_model_config)
407+
self.acoustic_encoder = acoustic_model.encoder
408+
self.acoustic_decoder = acoustic_model.decoder
408409
self._adjust_dac_decoder(self.acoustic_decoder)
409410
self.encoder_semantic = SemanticEncoder(config)
410411
self.decoder_semantic = SemanticDecoder(config)
@@ -417,14 +418,6 @@ def __init__(self, config):
417418
# Initialize weights and apply final processing
418419
self.post_init()
419420

420-
@property
421-
def acoustic_encoder(self):
422-
return self.acoustic_model.encoder
423-
424-
@property
425-
def acoustic_decoder(self):
426-
return self.acoustic_model.decoder
427-
428421
@staticmethod
429422
def _adjust_dac_decoder(decoder: nn.Module):
430423
r"""

0 commit comments

Comments
 (0)