Feature Extraction
Transformers
Safetensors
English
ultravox
custom_code
farzadab commited on
Commit
3c3e533
1 Parent(s): 0edbaeb

Update ultravox_model.py

Browse files
Files changed (1) hide show
  1. 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
- language_model = transformers.AutoModelForCausalLM.from_config(
230
- config.text_config, attn_implementation=config._attn_implementation
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