    def __init__(
        self,
        scheduler_name,
        unet_model_config_path=None,
        snr_gamma=None,
        uncondition=False,
    ):
        super().__init__()

        assert (
            unet_model_config_path is not None
        ), "Either UNet pretrain model name or a config file path is required"
        self.scheduler_name = scheduler_name
        self.unet_model_config_path = unet_model_config_path
        self.snr_gamma = snr_gamma
        self.uncondition = uncondition
        self.device = "cuda" if torch.cuda.is_available() else "cpu"
        # https://huggingface.co/docs/diffusers/v0.14.0/en/api/schedulers/overview
        self.noise_scheduler = DDPMScheduler.from_pretrained(
            self.scheduler_name, subfolder="scheduler"
        )
        self.inference_scheduler = DDPMScheduler.from_pretrained(
            self.scheduler_name, subfolder="scheduler"
        )
        unet_config = UNet2DConditionModel.load_config(unet_model_config_path)
        self.unet = UNet2DConditionModel.from_config(unet_config, subfolder="unet")
        print("UNet initialized randomly.")
        """
        self.text_encoder_name = "./checkpoint/models--google--flan-t5-large/" + \
           "snapshots/0613663d0d48ea86ba8cb3d7a44f0f65dc596a2a/"
        self.tokenizer = AutoTokenizer.from_pretrained(self.text_encoder_name)
        self.text_encoder = T5EncoderModel.from_pretrained(self.text_encoder_name)
        """
self.text_encoder_name = "./checkpoint/models--google--flan-t5-large/" + \
"snapshots/0613663d0d48ea86ba8cb3d7a44f0f65dc596a2a/"
self.tokenizer = AutoTokenizer.from_pretrained(self.text_encoder_name)
self.text_encoder = T5EncoderModel.from_pretrained(self.text_encoder_name)
models/tta/picoaudio/picoaudio/models/controllable_diffusion.py