Repository: huggingface/transformers
Pull request: fix tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest

@ydshieh please help review.

wo the PR, the following case will fail
```
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_00_hf_audio_xcodec_hubert_librispeech_0_5 - AssertionError: Tensor-likes are not equal!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_01_hf_audio_xcodec_hubert_librispeech_1_0 - AssertionError: Tensor-likes are not equal!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_02_hf_audio_xcodec_hubert_librispeech_1_5 - AssertionError: Tensor-likes are not equal!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_03_hf_audio_xcodec_hubert_librispeech_2_0 - AssertionError: Tensor-likes are not equal!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_04_hf_audio_xcodec_hubert_librispeech_4_0 - AssertionError: Tensor-likes are not close!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_05_hf_audio_xcodec_hubert_general_0_5 - AssertionError: Tensor-likes are not equal!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_06_hf_audio_xcodec_hubert_general_1_0 - AssertionError: Tensor-likes are not equal!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_07_hf_audio_xcodec_hubert_general_1_5 - AssertionError: Tensor-likes are not equal!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_08_hf_audio_xcodec_hubert_general_2_0 - AssertionError: Tensor-likes are not equal!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_09_hf_audio_xcodec_hubert_general_4_0 - AssertionError: Tensor-likes are not close!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_10_hf_audio_xcodec_hubert_general_balanced_0_5 - AssertionError: Tensor-likes are not equal!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_11_hf_audio_xcodec_hubert_general_balanced_1_0 - AssertionError: Tensor-likes are not equal!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_12_hf_audio_xcodec_hubert_general_balanced_1_5 - AssertionError: Tensor-likes are not equal!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_13_hf_audio_xcodec_hubert_general_balanced_2_0 - AssertionError: Tensor-likes are not equal!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_14_hf_audio_xcodec_hubert_general_balanced_4_0 - AssertionError: Scalars are not close!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_15_hf_audio_xcodec_wavlm_mls_0_5 - AssertionError: Tensor-likes are not close!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_16_hf_audio_xcodec_wavlm_mls_1_0 - AssertionError: Tensor-likes are not close!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_17_hf_audio_xcodec_wavlm_mls_1_5 - AssertionError: Tensor-likes are not close!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_18_hf_audio_xcodec_wavlm_mls_2_0 - AssertionError: Tensor-likes are not close!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_19_hf_audio_xcodec_wavlm_mls_4_0 - AssertionError: Tensor-likes are not close!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_20_hf_audio_xcodec_wavlm_more_data_0_5 - AssertionError: Tensor-likes are not equal!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_21_hf_audio_xcodec_wavlm_more_data_1_0 - AssertionError: Tensor-likes are not equal!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_22_hf_audio_xcodec_wavlm_more_data_1_5 - AssertionError: Tensor-likes are not close!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_23_hf_audio_xcodec_wavlm_more_data_2_0 - AssertionError: Tensor-likes are not close!
FAILED tests/models/xcodec/test_modeling_xcodec.py::XcodecIntegrationTest::test_integration_24_hf_audio_xcodec_wavlm_more_data_4_0 - AssertionError: Tensor-likes are not close!
```

Changed files:
filename: src/transformers/models/xcodec/modeling_xcodec.py
patch: @@ -403,8 +403,9 @@ def __init__(self, config):
         super().__init__(config)
         self.config = config
         self.pad = config.hop_length // 2
-        self.acoustic_model = AutoModel.from_config(config.acoustic_model_config)
-
+        acoustic_model = AutoModel.from_config(config.acoustic_model_config)
+        self.acoustic_encoder = acoustic_model.encoder
+        self.acoustic_decoder = acoustic_model.decoder
         self._adjust_dac_decoder(self.acoustic_decoder)
         self.encoder_semantic = SemanticEncoder(config)
         self.decoder_semantic = SemanticDecoder(config)
@@ -417,14 +418,6 @@ def __init__(self, config):
         # Initialize weights and apply final processing
         self.post_init()
 
-    @property
-    def acoustic_encoder(self):
-        return self.acoustic_model.encoder
-
-    @property
-    def acoustic_decoder(self):
-        return self.acoustic_model.decoder
-
     @staticmethod
     def _adjust_dac_decoder(decoder: nn.Module):
         r"""