in src/hyperpod_nemo_adapter/collections/model/sagemaker_base_model.py [0:0]
def _get_model_configurable_dict(self):
"""
Get the a dict that contains all configurable values of the current model
This method will only be used for child class
"""
config_dict = {}
for hf_config, recipe_configs in self._config_mapping_hf_to_recipe_aliases.items():
for recipe_alias in recipe_configs:
if self._cfg.get(recipe_alias, None) is not None:
if type(self._cfg.get(recipe_alias)).__name__ == "DictConfig":
# Check nested config, like rope_scaling
config_dict[hf_config] = dict(self._cfg.get(recipe_alias))
else:
config_dict[hf_config] = self._cfg.get(recipe_alias)
if dist.get_rank() == 0:
_logger.info(f"Overriding model config with {config_dict}")
return config_dict