code: def count_trainable_parameters(model):
      model_parameters = filter(
          lambda p: p.requires_grad, model.parameters()
      )
      params = sum([np.prod(p.size()) for p in model_parameters])
      return params
  
file_path: transformers/examples/research_projects/seq2seq-distillation/callbacks.py
imports: import logging
  from pathlib import Path
  import numpy
  import pytorch_lightning
  import torch
  from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint
  from pytorch_lightning.utilities import rank_zero_only
  from utils import save_json
label_desc: Use image node_id 1 for calling a global function with example usage: count_trainable_parameters(model) and returns: params