class_docstr: Class to load and save models and their checkpoints during training.
class_docstr_tok: ["Class","to","load","and","save","models","and","their","checkpoints","during","training","."]
code: def get_model_name_from_config(config: ConfigType) -> str:
      model_name = None
      if isinstance(config, Config):
          model_name = config.actor.model
      elif isinstance(config, ConfigReward) or isinstance(
          config, ConfigActor
      ):
          model_name = config.model
      if model_name in hf_models:
          return os.path.split(model_name)[-1]
      if model_name is None:
          raise ValueError("Model name not found")
      return model_name
  
file_path: nebuly/optimization/chatllama/chatllama/rlhf/model_loader.py
imports: import os
  import shutil
  from beartype.typing import Union, Optional, Tuple
  from chatllama.rlhf.config import Config, ConfigActor, ConfigCritic, ConfigReward
  from chatllama.rlhf.model_list import hf_models
label_desc: Use image node_id 8 for calling the ModelLoader obj's underlying member method code with example usage: obj.get_model_name_from_config(config) and returns: model_name, os