Update ultravox_model.py
Browse files- ultravox_model.py +4 -3
ultravox_model.py
CHANGED
@@ -226,9 +226,10 @@ class UltravoxModel(transformers.LlamaPreTrainedModel):
|
|
226 |
config.text_model_id, attn_implementation=config._attn_implementation
|
227 |
)
|
228 |
else:
|
229 |
-
|
230 |
-
|
231 |
-
|
|
|
232 |
|
233 |
language_model = apply_lora(language_model, config.text_model_lora_config)
|
234 |
return language_model
|
|
|
226 |
config.text_model_id, attn_implementation=config._attn_implementation
|
227 |
)
|
228 |
else:
|
229 |
+
with transformers.modeling_utils.no_init_weights:
|
230 |
+
language_model = transformers.AutoModelForCausalLM.from_config(
|
231 |
+
config.text_config, attn_implementation=config._attn_implementation
|
232 |
+
)
|
233 |
|
234 |
language_model = apply_lora(language_model, config.text_model_lora_config)
|
235 |
return language_model
|