def save_model(self, full_name=None):
        """
        save the trained model.

        Args:
            full_name (str, optional): File name to save the model's `state_dict()`.
                If it's None, the model is going to be saved under "fine_tuned"
                folder of the cached directory of the object. Defaults to None.
        """
        model_to_save = (
            self.model.module if hasattr(self.model, "module") else self.model
        )  # Take care of distributed/parallel training

        if full_name is None:
            output_model_dir = os.path.join(self.cache_dir, "fine_tuned")
            os.makedirs(self.cache_dir, exist_ok=True)
            os.makedirs(output_model_dir, exist_ok=True)
            full_name = os.path.join(output_model_dir, self.model_name)

        logger.info("Saving model checkpoint to %s", full_name)
        try:
            print("saving through pytorch")
            torch.save(model_to_save.state_dict(), full_name)
        except OSError:
            try:
                print("saving as pickle")
                pickle.dump(model_to_save.state_dict(), open(full_name, "wb"))
            except Exception:
                raise
        except Exception:
            raise

        save the trained model.

        Args:
            full_name (str, optional): File name to save the model's `state_dict()`.
                If it's None, the model is going to be saved under "fine_tuned"
                folder of the cached directory of the object. Defaults to None.
        
utils_nlp/models/transformers/extractive_summarization.py