def METHOD_NAME(cfg):
    trainer = pl.Trainer(**cfg.trainer)
    exp_manager(trainer, cfg.get("exp_manager", None))
    g2p_model = None
    if cfg.do_training:
        g2p_model = get_model(cfg, trainer)
        lr_logger = pl.callbacks.LearningRateMonitor()
        epoch_time_logger = LogEpochTimeCallback()
        trainer.callbacks.extend([lr_logger, epoch_time_logger])
        trainer.fit(g2p_model)
    if cfg.do_testing:
        logging.info(
            'During evaluation/testing, it is currently advisable to construct a new Trainer with single GPU and \
				no DDP to obtain accurate results'
        )
        # setup GPU
        if torch.cuda.is_available():
            device = [0]  # use 0th CUDA device
            accelerator = 'gpu'
        else:
            device = 1
            accelerator = 'cpu'
        map_location = torch.device('cuda:{}'.format(device[0]) if accelerator == 'gpu' else 'cpu')
        trainer = pl.Trainer(devices=device, accelerator=accelerator, logger=False, enable_checkpointing=False)
        if g2p_model is None:
            if os.path.exists(cfg.pretrained_model):
                # restore g2p_model from .nemo file path
                model_cfg = G2PModel.restore_from(restore_path=cfg.pretrained_model, return_config=True)
                classpath = model_cfg.target  # original class path
                imported_class = model_utils.import_class_by_path(classpath)
                logging.info(f"Restoring g2p_model : {imported_class.__name__}")
                g2p_model = imported_class.restore_from(restore_path=cfg.pretrained_model, map_location=map_location)
                model_name = os.path.splitext(os.path.basename(cfg.pretrained_model))[0]
                logging.info(f"Restored {model_name} g2p_model from {cfg.pretrained_model}.")
            elif cfg.pretrained_model in G2PModel.get_available_model_names():
                # restore g2p_model by name
                g2p_model = G2PModel.from_pretrained(cfg.pretrained_model, map_location=map_location)
            else:
                raise ValueError(
                    f'Provide path to the pre-trained .nemo checkpoint or choose from {G2PModel.list_available_models()}'
                )
        if hasattr(cfg.model, "test_ds") and cfg.model.test_ds.manifest_filepath is not None:
            g2p_model.setup_multiple_test_data(cfg.model.test_ds)
            if g2p_model.prepare_test(trainer):
                trainer.test(g2p_model)