class_docstr: Store the config parameters for the whole pipeline
  
  Args:
      trainer_dict (Optional[Dict]): Dictionary with the config parameters
          for the trainer. Default to None. If None, the config.yaml is
          used.
      actor_dict (Optional[Dict]): Dictionary with the config parameters
          for the actor. Default to None. If None, the config.yaml is
          used.
      critic_dict (Optional[Dict]): Dictionary with the config parameters
          for the critic. Default to None. If None, the config.yaml is
          used.
      reward_dict (Optional[Dict]): Dictionary with the config parameters
          for the reward. Default to None. If None, the config.yaml is
          used.
      device (Optional[torch.device]): Device to be used for the actor
          and critic. Default to None. If None, the device available is
          used.
      debug (Optional[bool]): Enable prints for debugging. Default to False.
  
  Attributes:
      trainer (ConfigTrainer): Config parameters for the trainer
      actor (ConfigActor): Config parameters for the actor
      critic (ConfigCritic): Config parameters for the critic
      reward (ConfigReward): Config parameters for the reward
code: def __init__(
      self,
      path: str,
      device: Optional[torch.device] = None,
      debug: Optional[bool] = False,
  ) -> None:
      # if not specified use the device available
      if device is None:
          if torch.cuda.is_available():
              device = torch.device("cuda")
          else:
              raise ValueError("No GPU available")
          print(f"Current device used :{str(device)}")
  
      if path is None or os.path.exists(path) is False:
          raise ValueError("Path to the config.yaml is not valid")
  
      # Read the config from yaml
      with open(path, "r") as c:
          config = yaml.safe_load(c)
  
      trainer_dict = config["trainer_config"]
      actor_dict = config["actor_config"]
      critic_dict = config["critic_config"]
      reward_dict = config["reward_config"]
  
      # Trainer Config
      trainer_dict["device"] = device
      trainer_dict["debug"] = debug
      self.trainer = ConfigTrainer(**trainer_dict)
      # Actor Config
      actor_dict["device"] = device
      actor_dict["debug"] = debug
      self.actor = ConfigActor(**actor_dict)
      # Critic Config
      critic_dict["device"] = device
      critic_dict["debug"] = debug
      self.critic = ConfigCritic(**critic_dict)
      self.critic.is_reward = False
      # Reward Config
      reward_dict["device"] = device
      reward_dict["debug"] = debug
      self.reward = ConfigReward(**reward_dict)
  
file_path: nebuly/optimization/chatllama/chatllama/rlhf/config.py
imports: import yaml
  import os
  from dataclasses import dataclass
  import torch
  from beartype import beartype
  from beartype.typing import Optional
label_desc: Use image node_id 1 to create a new Config object  with example: obj = Config(path, device, debug)