class_docstr: Upload checkpoints to wandb as an artifact, at the end of run.
class_docstr_tok: ["Upload","checkpoints","to","wandb","as","an","artifact",",","at","the","end","of","run","."]
code: def __init__(
      self,
      ckpt_dir: str = "checkpoints/",
      upload_best_only: bool = False,
  ):
      self.ckpt_dir = ckpt_dir
      self.upload_best_only = upload_best_only
  
imports: import subprocess
  from pathlib import Path
  from typing import List
  import matplotlib.pyplot
  import seaborn
  import torch
  import wandb
  from pytorch_lightning import Callback, Trainer
  from pytorch_lightning.loggers import LoggerCollection, WandbLogger
  from pytorch_lightning.utilities import rank_zero_only
  from sklearn import metrics
  from sklearn.metrics import f1_score, precision_score, recall_score
label_desc: Use image node_id 1 to create a new UploadCheckpointsAsArtifact object from inherited base classes: Callback with example: obj = UploadCheckpointsAsArtifact(ckpt_dir, upload_best_only)