code: def see_memory(detail=False):
      if detail:
          res = torch.cuda.memory_summary()
      else:
          res = (
              round(
                  torch.cuda.memory_allocated() / (1024 * 1024 * 1024),
                  2,
              ),
              round(
                  torch.cuda.max_memory_allocated()
                  / (1024 * 1024 * 1024),
                  2,
              ),
          )
      torch.cuda.reset_peak_memory_stats()
      return res
  
imports: import json
  import time
  from typing import Any, Dict, List, Union
  import torch
  import bmtrain
  import os
  from cpm_live.arguments import get_args
  from cpm_live.models import CPMBee, CPMBeeConfig
  from cpm_live.tokenizers import CPMBeeTokenizer
  from cpm_live.utils import allgather_objects, LogManager
  from cpm_live.training_tasks.bee import MixedDataset
label_desc: Use image node_id 7 for calling a global function with example usage: see_memory(detail) and returns: res