def METHOD_NAME(hypers: HypersBase, model, tokenizer: PreTrainedTokenizer, *, save_dir=None):
    if hypers.global_rank == 0:
        if save_dir is None:
            save_dir = hypers.output_dir
        # Create output directory if needed
        os.makedirs(save_dir, exist_ok=True)
        logger.info("Saving model to %s", save_dir)
        # Save a trained model, configuration and tokenizer using `save_pretrained()`.
        # They can then be reloaded using `from_pretrained()`
        model_to_save = (
            model.module if hasattr(model, "module") else model
        )  # Take care of distributed/parallel training
        torch.save(hypers, os.path.join(save_dir, "training_args.bin"))
        torch.save(model_to_save.state_dict(), os.path.join(save_dir, "model.bin"))
        if tokenizer is not None:
            tokenizer.save_pretrained(save_dir)