code: def save_model(self, path=None):
      if not path:
          path = self.output_dir / "model_out"
  
      path.mkdir(exist_ok=True)
  
      # Convert path to str for save_pretrained calls
      path = str(path)
  
      torch.cuda.empty_cache()
      # Save a trained model
      model_to_save = (
          self.model.module
          if hasattr(self.model, "module")
          else self.model
      )  # Only save the model it-self
      model_to_save.save_pretrained(path)
  
      # save the tokenizer
      self.data.tokenizer.save_pretrained(path)
  
file_path: fast-bert/fast_bert/learner_util.py
imports: import torch
  from pathlib import Path
  import logging
  from transformers import AdamW, get_constant_schedule, get_constant_schedule_with_warmup, get_linear_schedule_with_warmup, get_cosine_schedule_with_warmup, get_cosine_with_hard_restarts_schedule_with_warmup
  from pytorch_lamb import Lamb
label_desc: Use image node_id 4 for calling the Learner obj's underlying member method code with example usage: obj.save_model(path) without return types