File tree Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -532,16 +532,12 @@ def __post_init__(self) -> None:
532
532
self .config_format = ConfigFormat (self .config_format )
533
533
534
534
hf_config = get_config (self .hf_config_path or self .model ,
535
- self .trust_remote_code , self .revision ,
536
- self .code_revision , self .config_format )
537
-
538
- if hf_overrides_kw :
539
- logger .debug ("Overriding HF config with %s" , hf_overrides_kw )
540
- hf_config .update (hf_overrides_kw )
541
- if hf_overrides_fn :
542
- logger .debug ("Overriding HF config with %s" , hf_overrides_fn )
543
- hf_config = hf_overrides_fn (hf_config )
544
-
535
+ self .trust_remote_code ,
536
+ self .revision ,
537
+ self .code_revision ,
538
+ self .config_format ,
539
+ hf_overrides_kw = hf_overrides_kw ,
540
+ hf_overrides_fn = hf_overrides_fn )
545
541
self .hf_config = hf_config
546
542
547
543
self .hf_text_config = get_hf_text_config (self .hf_config )
@@ -5052,4 +5048,4 @@ class SpeechToTextConfig:
5052
5048
5053
5049
@property
5054
5050
def allow_audio_chunking (self ) -> bool :
5055
- return self .min_energy_split_window_size is not None
5051
+ return self .min_energy_split_window_size is not None
Original file line number Diff line number Diff line change @@ -305,6 +305,9 @@ def get_config(
305
305
revision : Optional [str ] = None ,
306
306
code_revision : Optional [str ] = None ,
307
307
config_format : ConfigFormat = ConfigFormat .AUTO ,
308
+ hf_overrides_kw : Optional [dict [str , Any ]] = None ,
309
+ hf_overrides_fn : Optional [Callable [[PretrainedConfig ],
310
+ PretrainedConfig ]] = None ,
308
311
** kwargs ,
309
312
) -> PretrainedConfig :
310
313
# Separate model folder from file path for GGUF models
@@ -423,6 +426,13 @@ def get_config(
423
426
model_type = MODEL_FOR_CAUSAL_LM_MAPPING_NAMES [config .model_type ]
424
427
config .update ({"architectures" : [model_type ]})
425
428
429
+ if hf_overrides_kw :
430
+ logger .debug ("Overriding HF config with %s" , hf_overrides_kw )
431
+ config .update (hf_overrides_kw )
432
+ if hf_overrides_fn :
433
+ logger .debug ("Overriding HF config with %s" , hf_overrides_fn )
434
+ config = hf_overrides_fn (config )
435
+
426
436
patch_rope_scaling (config )
427
437
428
438
if trust_remote_code :
You can’t perform that action at this time.
0 commit comments