Update modelling_musilingo.py
Browse files- modelling_musilingo.py +4 -2
modelling_musilingo.py
CHANGED
|
@@ -23,7 +23,7 @@ from .configuration_musilingo import MusiLingoConfig, PATH
|
|
| 23 |
import timm.models.hub as timm_hub
|
| 24 |
|
| 25 |
|
| 26 |
-
from transformers import LlamaTokenizer, Wav2Vec2FeatureExtractor, AutoModel
|
| 27 |
from transformers.activations import ACT2FN
|
| 28 |
from transformers.modeling_outputs import BaseModelOutputWithPast, CausalLMOutputWithPast
|
| 29 |
from transformers.modeling_utils import PreTrainedModel
|
|
@@ -2032,7 +2032,9 @@ class MusiLingo(BaseModel):
|
|
| 2032 |
self.low_resource = low_resource
|
| 2033 |
|
| 2034 |
print('Loading Audio Encoder')
|
| 2035 |
-
|
|
|
|
|
|
|
| 2036 |
# loading the corresponding preprocessor config
|
| 2037 |
self.processor = Wav2Vec2FeatureExtractor.from_pretrained(mert_model, trust_remote_code=True)
|
| 2038 |
|
|
|
|
| 23 |
import timm.models.hub as timm_hub
|
| 24 |
|
| 25 |
|
| 26 |
+
from transformers import LlamaTokenizer, Wav2Vec2FeatureExtractor, AutoModel, AutoConfig
|
| 27 |
from transformers.activations import ACT2FN
|
| 28 |
from transformers.modeling_outputs import BaseModelOutputWithPast, CausalLMOutputWithPast
|
| 29 |
from transformers.modeling_utils import PreTrainedModel
|
|
|
|
| 2032 |
self.low_resource = low_resource
|
| 2033 |
|
| 2034 |
print('Loading Audio Encoder')
|
| 2035 |
+
mert_modelconfig = AutoConfig.from_pretrained(mert_model, trust_remote_code=True)
|
| 2036 |
+
mert_modelconfig.conv_pos_batch_norm = False
|
| 2037 |
+
self.audio_encoder = AutoModel.from_pretrained(mert_model, config=mert_modelconfig,trust_remote_code=True)
|
| 2038 |
# loading the corresponding preprocessor config
|
| 2039 |
self.processor = Wav2Vec2FeatureExtractor.from_pretrained(mert_model, trust_remote_code=True)
|
| 2040 |
|