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","."]
docstr: Method to initialize the critic from the reward model.
  If the critic folder is empty
docstr_tok: ["Method","to","initialize","the","critic","from","the","reward","model",".","If","the","critic","folder","is","empty"]
code: def init_critic_from_reward(config: ConfigCritic) -> None:
      """Method to initialize the critic from the reward model.
      If the critic folder is empty
      """
  
      if config.is_reward is True:
          raise ValueError(
              "The config should work for the Critic model,"
              "but the config seems to be for the Reward model"
          )
  
      # check that the critic folder is empty
      path = ModelLoader.check_model_path(config)
      _, _, critic_path = ModelLoader.get_model_path(config)
      if path is None:
          print("Initializing Critic from Reward model...")
          config.is_reward = True
          path = ModelLoader.check_model_path(config)
          if path is not None:
              _, _, reward_path = ModelLoader.get_model_path(config)
              # copy the file in reward_path to critic_path
              shutil.copy(reward_path, critic_path)
          else:
              print("Critic Model remains uninitialized")
      config.is_reward = False
  
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 12 for calling the ModelLoader obj's underlying member method code with example usage: obj.init_critic_from_reward(config) without return types