class_docstr: An internal YOLO model wrapper that tracks metrics, and logs models to Weights & Biases.
  
  Usage:
  ```python
  from wandb.integration.yolov8.yolov8 import WandbCallback
  
  model = YOLO("yolov8n.pt")
  wandb_logger = WandbCallback(
      model,
  )
  for event, callback_fn in wandb_logger.callbacks.items():
      model.add_callback(event, callback_fn)
  ```
class_docstr_tok: ["An","internal","YOLO","model","wrapper","that","tracks","metrics",",","and","logs","models","to","Weights","&","Biases",".","Usage",":","``","`","python","from","wandb.integration.yolov8.yolov8","import","WandbCallback","model","=","YOLO","(","``","yolov8n.pt","''",")","wandb_logger","=","WandbCallback","(","model",",",")","for","event",",","callback_fn","in","wandb_logger.callbacks.items","(",")",":","model.add_callback","(","event",",","callback_fn",")","``","`"]
docstr: On model save we log the model as an artifact to Weights & Biases.
docstr_tok: ["On","model","save","we","log","the","model","as","an","artifact","to","Weights","&","Biases","."]
code: def on_model_save(self, trainer: BaseTrainer) -> None:
      """On model save we log the model as an artifact to Weights & Biases."""
      assert self.run is not None
      self.run.log_artifact(
          str(trainer.last),
          type="model",
          name=f"{self.run.name}_{trainer.args.task}.pt",
          aliases=["last", f"epoch_{trainer.epoch + 1}"],
      )
  
file_path: wandb/wandb/integration/yolov8/yolov8.py
imports: from typing import Any, Callable, Dict, List, Optional
  from ultralytics.yolo.engine.model import YOLO
  from ultralytics.yolo.engine.trainer import BaseTrainer
  from ultralytics.yolo.v8.classify.train import ClassificationTrainer
  import wandb
  from wandb.sdk.lib import telemetry
label_desc: Use image node_id 8 for calling the WandbCallback obj's underlying member method code with example usage: obj.on_model_save(trainer) without return types