File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -423,19 +423,19 @@ def load_hparams(dir_model: Path):
423423 try :
424424 # for security reason, we don't allow loading remote code by default
425425 # if a model need remote code, we will fallback to config.json
426- return AutoConfig .from_pretrained (dir_model , trust_remote_code = False ).to_dict ()
426+ config = AutoConfig .from_pretrained (dir_model , trust_remote_code = False ).to_dict ()
427427 except Exception as e :
428428 logger .warning (f"Failed to load model config from { dir_model } : { e } " )
429429 logger .warning ("Trying to load config.json instead" )
430430 with open (dir_model / "config.json" , "r" , encoding = "utf-8" ) as f :
431431 config = json .load (f )
432- if "llm_config" in config :
433- # rename for InternVL
434- config ["text_config" ] = config ["llm_config" ]
435- if "thinker_config" in config :
436- # rename for Qwen2.5-Omni
437- config ["text_config" ] = config ["thinker_config" ]["text_config" ]
438- return config
432+ if "llm_config" in config :
433+ # rename for InternVL
434+ config ["text_config" ] = config ["llm_config" ]
435+ if "thinker_config" in config :
436+ # rename for Qwen2.5-Omni
437+ config ["text_config" ] = config ["thinker_config" ]["text_config" ]
438+ return config
439439
440440 @classmethod
441441 def register (cls , * names : str ) -> Callable [[AnyModel ], AnyModel ]:
You can’t perform that action at this time.
0 commit comments