class_docstr: Training statistics
  
  Attributes:
      training_loss (List): List of training losses
      training_accuracy (List): List of training accuracies
      value_loss (List): List of value losses
      validation_loss (List): List of validation losses
      validation_accuracy (List): List of validation accuracies
class_docstr_tok: ["Training","statistics","Attributes",":","training_loss","(","List",")",":","List","of","training","losses","training_accuracy","(","List",")",":","List","of","training","accuracies","value_loss","(","List",")",":","List","of","value","losses","validation_loss","(","List",")",":","List","of","validation","losses","validation_accuracy","(","List",")",":","List","of","validation","accuracies"]
docstr: Save the stats
docstr_tok: ["Save","the","stats"]
code: def save(
      self,
  ):
      """Save the stats"""
      if os.path.exists(self.path):
          with open(self.path, "r") as f:
              stats = json.load(f)
          stats["training_loss"].extend(self.training_loss)
          stats["training_accuracy"].extend(self.training_accuracy)
          stats["value_loss"].extend(self.value_loss)
          stats["validation_loss"].extend(self.validation_loss)
          stats["validation_accuracy"].extend(self.validation_accuracy)
      else:
          stats = {
              "training_loss": self.training_loss,
              "training_accuracy": self.training_accuracy,
              "value_loss": self.value_loss,
              "validation_loss": self.validation_loss,
              "validation_accuracy": self.validation_accuracy,
          }
      with open(self.path, "w") as f:
          json.dump(stats, f, indent=4)
  
file_path: nebuly/optimization/chatllama/chatllama/rlhf/utils.py
imports: import json
  import os
  from beartype import beartype
  from plotly import graph_objects
label_desc: Use image node_id 3 for calling the TrainingStats obj's underlying member method code with example usage: obj.save() without return types