


import gc
import unittest

import numpy as np
import torch
import torch.nn.functional as F
from transformers import (
    ClapTextConfig,
    ClapTextModelWithProjection,
    RobertaTokenizer,
    SpeechTaHifiGan,
    SpeechTaHifiGanConfig,
)

from diffusers import (
    AudioLDMPipeline,
    AutoencoderKL,
    DDIMScheduler,
    LMSDiscreteScheduler,
    PNDMScheduler,
    UNetaDConditionModel,
)
from diffusers.utils import is_xformers_available, slow, torch_device
from diffusers.utils.testing_utils import enable_full_determinism

from ..pipeline_params import TEXT_TO_AUDIO_BATCH_PARAMS, TEXT_TO_AUDIO_PARAMS
from ..test_pipelines_common import PipelineTesterMixin


enable_full_determinism()
class 				SCREAMING_SNAKE_CASE__						(       __lowercase		,					unittest.TestCase    ):
      snake_case__       :  int       =		AudioLDMPipeline
      snake_case__       :  int       =		TEXT_TO_AUDIO_PARAMS
      snake_case__       :  Any       =		TEXT_TO_AUDIO_BATCH_PARAMS
      snake_case__       :  Optional[Any]       =		frozenset(
          [
              '''num_inference_steps''',
              '''num_waveforms_per_prompt''',
              '''generator''',
              '''latents''',
              '''output_type''',
              '''return_dict''',
              '''callback''',
              '''callback_steps''',
          ]    )
      def  SCREAMING_SNAKE_CASE							( self       : Optional[Any]  )	->    Dict:
             torch.manual_seed(0  )
             a_      :	List[str]							=						UNetaDConditionModel(
                 block_out_channels=(3_2, 6_4)  ,							layers_per_block=2  ,							sample_size=3_2  ,							in_channels=4  ,							out_channels=4  ,							down_block_types=('DownBlock2D', 'CrossAttnDownBlock2D')  ,							up_block_types=('CrossAttnUpBlock2D', 'UpBlock2D')  ,							cross_attention_dim=(3_2, 6_4)  ,							class_embed_type='simple_projection'  ,							projection_class_embeddings_input_dim=3_2  ,							class_embeddings_concat=_A  ,							)
             a_      :	int							=						DDIMScheduler(
                 beta_start=0.00085  ,							beta_end=0.012  ,							beta_schedule='scaled_linear'  ,							clip_sample=_A  ,							set_alpha_to_one=_A  ,							)
             torch.manual_seed(0  )
             a_      :	Tuple							=						AutoencoderKL(
                 block_out_channels=[3_2, 6_4]  ,							in_channels=1  ,							out_channels=1  ,							down_block_types=['DownEncoderBlock2D', 'DownEncoderBlock2D']  ,							up_block_types=['UpDecoderBlock2D', 'UpDecoderBlock2D']  ,							latent_channels=4  ,							)
             torch.manual_seed(0  )
             a_      :	Dict							=						ClapTextConfig(
                 bos_token_id=0  ,							eos_token_id=2  ,							hidden_size=3_2  ,							intermediate_size=3_7  ,							layer_norm_eps=1E-05  ,							num_attention_heads=4  ,							num_hidden_layers=5  ,							pad_token_id=1  ,							vocab_size=1_0_0_0  ,							projection_dim=3_2  ,							)
             a_      :	List[Any]							=						ClapTextModelWithProjection(_A  )
             a_      :	Tuple							=						RobertaTokenizer.from_pretrained('hf-internal-testing/tiny-random-roberta'  ,							model_max_length=7_7  )

             a_      :	Optional[Any]							=						SpeechTaHifiGanConfig(
                 model_in_dim=8  ,							sampling_rate=1_6_0_0_0  ,							upsample_initial_channel=1_6  ,							upsample_rates=[2, 2]  ,							upsample_kernel_sizes=[4, 4]  ,							resblock_kernel_sizes=[3, 7]  ,							resblock_dilation_sizes=[[1, 3, 5], [1, 3, 5]]  ,							normalize_before=_A  ,							)

             a_      :	int							=						SpeechTaHifiGan(_A  )

             a_      :	Optional[Any]							=						{
                 'unet': unet,
                 'scheduler': scheduler,
                 'vae': vae,
                 'text_encoder': text_encoder,
                 'tokenizer': tokenizer,
                 'vocoder': vocoder,
             }
             return components
      def  SCREAMING_SNAKE_CASE							( self       : Optional[int]  ,							SCREAMING_SNAKE_CASE__       : int  ,							SCREAMING_SNAKE_CASE__       : Optional[int]=0  )	->    Dict:
             if str(_A  ).startswith('mps'  ):
                    a_      :	Dict							=						torch.manual_seed(_A  )
             else:
                    a_      :	Union[str, Any]							=						torch.Generator(device=_A  ).manual_seed(_A  )
             a_      :	Any							=						{
                 'prompt': 'A hammer hitting a wooden surface',
                 'generator': generator,
                 'num_inference_steps': 2,
                 'guidance_scale': 6.0,
             }
             return inputs
      def  SCREAMING_SNAKE_CASE							( self       : Any  )	->    List[Any]:
             a_      :	int							=						'cpu'  # ensure determinism for the device-dependent torch.Generator

             a_      :	Tuple							=						self.get_dummy_components()
             a_      :	Tuple							=						AudioLDMPipeline(**_A  )
             a_      :	Dict							=						audioldm_pipe.to(_A  )
             audioldm_pipe.set_progress_bar_config(disable=_A  )

             a_      :	Union[str, Any]							=						self.get_dummy_inputs(_A  )
             a_      :	Any							=						audioldm_pipe(**_A  )
             a_      :	Optional[Any]							=						output.audios[0]

             assert audio.ndim == 1
             assert len(_A  ) == 2_5_6

             a_      :	Any							=						audio[:1_0]
             a_      :	Optional[int]							=						np.array(
                 [-0.0050, 0.0050, -0.0060, 0.0033, -0.0026, 0.0033, -0.0027, 0.0033, -0.0028, 0.0033]  )

             assert np.abs(audio_slice - expected_slice  ).max() < 1E-2
      def  SCREAMING_SNAKE_CASE							( self       : Optional[int]  )	->    str:
             a_      :	List[Any]							=						self.get_dummy_components()
             a_      :	str							=						AudioLDMPipeline(**_A  )
             a_      :	List[str]							=						audioldm_pipe.to(_A  )
             a_      :	str							=						audioldm_pipe.to(_A  )
             audioldm_pipe.set_progress_bar_config(disable=_A  )

             a_      :	int							=						self.get_dummy_inputs(_A  )
             a_      :	Any							=						3 * [inputs['prompt']]

             # forward
             a_      :	Tuple							=						audioldm_pipe(**_A  )
             a_      :	List[Any]							=						output.audios[0]

             a_      :	List[Any]							=						self.get_dummy_inputs(_A  )
             a_      :	List[Any]							=						3 * [inputs.pop('prompt'  )]

             a_      :	int							=						audioldm_pipe.tokenizer(
                 _A  ,							padding='max_length'  ,							max_length=audioldm_pipe.tokenizer.model_max_length  ,							truncation=_A  ,							return_tensors='pt'  ,							)
             a_      :	List[str]							=						text_inputs['input_ids'].to(_A  )

             a_      :	List[Any]							=						audioldm_pipe.text_encoder(
                 _A  ,							)
             a_      :	int							=						prompt_embeds.text_embeds
             # additional L_2 normalization over each hidden-state
             a_      :	Any							=						F.normalize(_A  ,							dim=-1  )

             a_      :	Union[str, Any]							=						prompt_embeds

             # forward
             a_      :	Optional[Any]							=						audioldm_pipe(**_A  )
             a_      :	Tuple							=						output.audios[0]

             assert np.abs(audio_a - audio_a  ).max() < 1E-2
      def  SCREAMING_SNAKE_CASE							( self       : List[Any]  )	->    List[str]:
             a_      :	Dict							=						self.get_dummy_components()
             a_      :	Tuple							=						AudioLDMPipeline(**_A  )
             a_      :	int							=						audioldm_pipe.to(_A  )
             a_      :	List[Any]							=						audioldm_pipe.to(_A  )
             audioldm_pipe.set_progress_bar_config(disable=_A  )

             a_      :	List[Any]							=						self.get_dummy_inputs(_A  )
             a_      :	List[str]							=						3 * ['this is a negative prompt']
             a_      :	Optional[int]							=						negative_prompt
             a_      :	Union[str, Any]							=						3 * [inputs['prompt']]

             # forward
             a_      :	Tuple							=						audioldm_pipe(**_A  )
             a_      :	Any							=						output.audios[0]

             a_      :	Any							=						self.get_dummy_inputs(_A  )
             a_      :	str							=						3 * [inputs.pop('prompt'  )]

             a_      :	Dict							=						[]
             for p in [prompt, negative_prompt]:
                    a_      :	Union[str, Any]							=						audioldm_pipe.tokenizer(
                        _A  ,							padding='max_length'  ,							max_length=audioldm_pipe.tokenizer.model_max_length  ,							truncation=_A  ,							return_tensors='pt'  ,							)
                    a_      :	List[str]							=						text_inputs['input_ids'].to(_A  )

                    a_      :	List[Any]							=						audioldm_pipe.text_encoder(
                        _A  ,							)
                    a_      :	Optional[Any]							=						text_embeds.text_embeds
                    # additional L_2 normalization over each hidden-state
                    a_      :	Dict							=						F.normalize(_A  ,							dim=-1  )

                    embeds.append(_A  )

             a_							,	a_      :	Any							=						embeds

             # forward
             a_      :	Dict							=						audioldm_pipe(**_A  )
             a_      :	int							=						output.audios[0]

             assert np.abs(audio_a - audio_a  ).max() < 1E-2
      def  SCREAMING_SNAKE_CASE							( self       : str  )	->    Tuple:
             a_      :	Union[str, Any]							=						'cpu'  # ensure determinism for the device-dependent torch.Generator
             a_      :	List[str]							=						self.get_dummy_components()
             a_      :	List[Any]							=						PNDMScheduler(skip_prk_steps=_A  )
             a_      :	str							=						AudioLDMPipeline(**_A  )
             a_      :	Optional[Any]							=						audioldm_pipe.to(_A  )
             audioldm_pipe.set_progress_bar_config(disable=_A  )

             a_      :	str							=						self.get_dummy_inputs(_A  )
             a_      :	Tuple							=						'egg cracking'
             a_      :	Optional[int]							=						audioldm_pipe(**_A  ,							negative_prompt=_A  )
             a_      :	List[Any]							=						output.audios[0]

             assert audio.ndim == 1
             assert len(_A  ) == 2_5_6

             a_      :	Tuple							=						audio[:1_0]
             a_      :	Any							=						np.array(
                 [-0.0051, 0.0050, -0.0060, 0.0034, -0.0026, 0.0033, -0.0027, 0.0033, -0.0028, 0.0032]  )

             assert np.abs(audio_slice - expected_slice  ).max() < 1E-2
      def  SCREAMING_SNAKE_CASE							( self       : Tuple  )	->    Dict:
             a_      :	Any							=						'cpu'  # ensure determinism for the device-dependent torch.Generator
             a_      :	Dict							=						self.get_dummy_components()
             a_      :	str							=						PNDMScheduler(skip_prk_steps=_A  )
             a_      :	Optional[int]							=						AudioLDMPipeline(**_A  )
             a_      :	Optional[Any]							=						audioldm_pipe.to(_A  )
             audioldm_pipe.set_progress_bar_config(disable=_A  )

             a_      :	List[str]							=						'A hammer hitting a wooden surface'

             # test num_waveforms_per_prompt=1 (default)
             a_      :	Union[str, Any]							=						audioldm_pipe(_A  ,							num_inference_steps=2  ).audios

             assert audios.shape == (1, 2_5_6)

             # test num_waveforms_per_prompt=1 (default) for batch of prompts
             a_      :	Dict							=						2
             a_      :	Union[str, Any]							=						audioldm_pipe([prompt] * batch_size  ,							num_inference_steps=2  ).audios

             assert audios.shape == (batch_size, 2_5_6)

             # test num_waveforms_per_prompt for single prompt
             a_      :	int							=						2
             a_      :	Any							=						audioldm_pipe(_A  ,							num_inference_steps=2  ,							num_waveforms_per_prompt=_A  ).audios

             assert audios.shape == (num_waveforms_per_prompt, 2_5_6)

             # test num_waveforms_per_prompt for batch of prompts
             a_      :	Tuple							=						2
             a_      :	List[Any]							=						audioldm_pipe(
                 [prompt] * batch_size  ,							num_inference_steps=2  ,							num_waveforms_per_prompt=_A  ).audios

             assert audios.shape == (batch_size * num_waveforms_per_prompt, 2_5_6)
      def  SCREAMING_SNAKE_CASE							( self       : Tuple  )	->    int:
             a_      :	Union[str, Any]							=						'cpu'  # ensure determinism for the device-dependent torch.Generator
             a_      :	Union[str, Any]							=						self.get_dummy_components()
             a_      :	Optional[Any]							=						AudioLDMPipeline(**_A  )
             a_      :	Optional[Any]							=						audioldm_pipe.to(_A  )
             audioldm_pipe.set_progress_bar_config(disable=_A  )
             a_      :	Optional[int]							=						audioldm_pipe.vocoder.config.sampling_rate

             a_      :	Optional[int]							=						self.get_dummy_inputs(_A  )
             a_      :	str							=						audioldm_pipe(audio_length_in_s=0.016  ,							**_A  )
             a_      :	Optional[Any]							=						output.audios[0]

             assert audio.ndim == 1
             assert len(_A  ) / vocoder_sampling_rate == 0.016

             a_      :	Dict							=						audioldm_pipe(audio_length_in_s=0.032  ,							**_A  )
             a_      :	Union[str, Any]							=						output.audios[0]

             assert audio.ndim == 1
             assert len(_A  ) / vocoder_sampling_rate == 0.032
      def  SCREAMING_SNAKE_CASE							( self       : Tuple  )	->    List[Any]:
             a_      :	Any							=						self.get_dummy_components()
             a_      :	Dict							=						AudioLDMPipeline(**_A  )
             a_      :	Tuple							=						audioldm_pipe.to(_A  )
             audioldm_pipe.set_progress_bar_config(disable=_A  )

             a_      :	Dict							=						['hey']

             a_      :	Any							=						audioldm_pipe(_A  ,							num_inference_steps=1  )
             a_      :	Any							=						output.audios.shape
             assert audio_shape == (1, 2_5_6)

             a_      :	Tuple							=						audioldm_pipe.vocoder.config
             config.model_in_dim *= 2
             a_      :	Optional[int]							=						SpeechTaHifiGan(_A  ).to(_A  )
             a_      :	int							=						audioldm_pipe(_A  ,							num_inference_steps=1  )
             a_      :	Optional[int]							=						output.audios.shape
             # waveform shape is unchanged, we just have 2x the number of mel channels in the spectrogram
             assert audio_shape == (1, 2_5_6)
      def  SCREAMING_SNAKE_CASE							( self       : Optional[int]  )	->    Dict:
             self._test_attention_slicing_forward_pass(test_mean_pixel_difference=_A  )
      def  SCREAMING_SNAKE_CASE							( self       : str  )	->    Dict:
             self._test_inference_batch_single_identical(test_mean_pixel_difference=_A  )

      @unittest.skipIf(
          torch_device != 'cuda' or not is_xformers_available()  ,							reason='XFormers attention is only available with CUDA and `xformers` installed'  ,							)
      def  SCREAMING_SNAKE_CASE							( self       : Union[str, Any]  )	->    List[Any]:
             self._test_xformers_attention_forwardGenerator_pass(test_mean_pixel_difference=_A  )
@slow
class 				SCREAMING_SNAKE_CASE__						(       unittest.TestCase    ):
      def  SCREAMING_SNAKE_CASE							( self       : Optional[int]  )	->    Optional[Any]:
             super().tearDown()
             gc.collect()
             torch.cuda.empty_cache()
      def  SCREAMING_SNAKE_CASE							( self       : List[str]  ,							SCREAMING_SNAKE_CASE__       : Union[str, Any]  ,							SCREAMING_SNAKE_CASE__       : List[str]="cpu"  ,							SCREAMING_SNAKE_CASE__       : Any=torch.floataa  ,							SCREAMING_SNAKE_CASE__       : Dict=0  )	->    Optional[Any]:
             a_      :	List[str]							=						torch.Generator(device=_A  ).manual_seed(_A  )
             a_      :	List[str]							=						np.random.RandomState(_A  ).standard_normal((1, 8, 1_2_8, 1_6)  )
             a_      :	Union[str, Any]							=						torch.from_numpy(_A  ).to(device=_A  ,							dtype=_A  )
             a_      :	List[str]							=						{
                 'prompt': 'A hammer hitting a wooden surface',
                 'latents': latents,
                 'generator': generator,
                 'num_inference_steps': 3,
                 'guidance_scale': 2.5,
             }
             return inputs
      def  SCREAMING_SNAKE_CASE							( self       : List[Any]  )	->    str:
             a_      :	str							=						AudioLDMPipeline.from_pretrained('cvssp/audioldm'  )
             a_      :	int							=						audioldm_pipe.to(_A  )
             audioldm_pipe.set_progress_bar_config(disable=_A  )

             a_      :	str							=						self.get_inputs(_A  )
             a_      :	Any							=						2_5
             a_      :	Union[str, Any]							=						audioldm_pipe(**_A  ).audios[0]

             assert audio.ndim == 1
             assert len(_A  ) == 8_1_9_2_0

             a_      :	Optional[Any]							=						audio[7_7_2_3_0:7_7_2_4_0]
             a_      :	int							=						np.array(
                 [-0.4884, -0.4607, 0.0023, 0.5007, 0.5896, 0.5151, 0.3813, -0.0208, -0.3687, -0.4315]  )
             a_      :	Union[str, Any]							=						np.abs(expected_slice - audio_slice  ).max()
             assert max_diff < 1E-2

      def  SCREAMING_SNAKE_CASE							( self       : Dict  )	->    Optional[Any]:
             a_      :	Tuple							=						AudioLDMPipeline.from_pretrained('cvssp/audioldm'  )
             a_      :	Tuple							=						LMSDiscreteScheduler.from_config(audioldm_pipe.scheduler.config  )
             a_      :	Optional[Any]							=						audioldm_pipe.to(_A  )
             audioldm_pipe.set_progress_bar_config(disable=_A  )

             a_      :	Union[str, Any]							=						self.get_inputs(_A  )
             a_      :	Tuple							=						audioldm_pipe(**_A  ).audios[0]

             assert audio.ndim == 1
             assert len(_A  ) == 8_1_9_2_0

             a_      :	List[Any]							=						audio[2_7_7_8_0:2_7_7_9_0]
             a_      :	Optional[Any]							=						np.array([-0.2131, -0.0873, -0.0124, -0.0189, 0.0569, 0.1373, 0.1883, 0.2886, 0.3297, 0.2212]  )
             a_      :	int							=						np.abs(expected_slice - audio_slice  ).max()
             assert max_diff < 3E-2






import argparse
import os
from pathlib import Path
from typing import Dict

import tensorflow as tf
import torch
from tqdm import tqdm

from transformers import PegasusConfig, PegasusForConditionalGeneration, PegasusTokenizer
from transformers.models.pegasus.configuration_pegasus import DEFAULTS, task_specific_params


UpperCAmelCase_   :				Optional[int]						      = [
    # replace left string with right string to get the relevant state_dict key (identical state dict to bart)
    ['memory_attention', 'encoder_attn'],
    ['attention', 'attn'],
    ['/', '.'],
    ['.LayerNorm.gamma', '_layer_norm.weight'],
    ['.LayerNorm.beta', '_layer_norm.bias'],
    ['r.layer_', 'r.layers.'],
    ['output_proj', 'out_proj'],
    ['ffn.dense_1.', 'fc2.'],
    ['ffn.dense.', 'fc1.'],
    ['ffn_layer_norm', 'final_layer_norm'],
    ['kernel', 'weight'],
    ['encoder_layer_norm.', 'encoder.layer_norm.'],
    ['decoder_layer_norm.', 'decoder.layer_norm.'],
    ['embeddings.weights', 'shared.weight'],
]







def  SCREAMING_SNAKE_CASE_		(    __A				:    Any       )			->	Union[str, Any]:

       """simple docstring"""

       for pegasus_name, hf_name in PATTERNS:
              a_      :	Union[str, Any]							=						k.replace(__A						,					__A       )
       return k







def  SCREAMING_SNAKE_CASE_		(    __A				:    dict						,					__A				:    dict       )			->	PegasusForConditionalGeneration:

       """simple docstring"""

       a_      :	int							=						DEFAULTS.copy()
       cfg_kwargs.update(__A       )
       a_      :	List[str]							=						PegasusConfig(**__A       )
       a_      :	List[Any]							=						PegasusForConditionalGeneration(__A       )
       a_      :	List[str]							=						torch_model.model.state_dict()
       a_      :	Optional[int]							=						{}
       for k, v in tf_weights.items():
              a_      :	str							=						rename_state_dict_key(__A       )
              if new_k not in sd:
                     raise ValueError(F"""could not find new key {new_k} in state dict. (converted from {k})"""       )

              if "dense" in k or "proj" in new_k:
                     a_      :	Union[str, Any]							=						v.T
              a_      :	List[str]							=						torch.tensor(__A						,					dtype=sd[new_k].dtype       )
              assert v.shape == sd[new_k].shape, F"""{new_k}, {k}, {v.shape}, {sd[new_k].shape}"""
       # make sure embedding.padding_idx is respected
       a_      :	int							=						torch.zeros_like(mapping['shared.weight'][cfg.pad_token_id + 1]       )
       a_      :	Optional[Any]							=						mapping['shared.weight']
       a_      :	Any							=						mapping['shared.weight']
       a_      :	Optional[int]							=						{k: torch.zeros_like(__A       ) for k, v in sd.items() if k.endswith('bias'       ) and k not in mapping}
       mapping.update(**__A       )
       a_							,	a_      :	Optional[Any]							=						torch_model.model.load_state_dict(__A						,					strict=__A       )
       a_      :	Optional[Any]							=						[
           k for k in missing if k not in ['encoder.embed_positions.weight', 'decoder.embed_positions.weight']
       ]
       assert unexpected_missing == [], F"""no matches found for the following torch keys {unexpected_missing}"""
       assert extra == [], F"""no matches found for the following tf keys {extra}"""
       return torch_model







def  SCREAMING_SNAKE_CASE_		(    __A				:    Dict="./ckpt/aeslc/model.ckpt-32000"       )			->	Dict:

       """simple docstring"""

       a_      :	List[Any]							=						tf.train.list_variables(__A       )
       a_      :	Optional[Any]							=						{}
       a_      :	int							=						['Adafactor', 'global_step']
       for name, shape in tqdm(__A						,					desc='converting tf checkpoint to dict'       ):
              a_      :	Optional[int]							=						any(pat in name for pat in ignore_name       )
              if skip_key:
                     continue
              a_      :	List[str]							=						tf.train.load_variable(__A						,					__A       )
              a_      :	Optional[Any]							=						array
       return tf_weights







def  SCREAMING_SNAKE_CASE_		(    __A				:    str						,					__A				:    str       )			->	Union[str, Any]:

       """simple docstring"""

       a_      :	Any							=						Path(__A       ).parent.name
       a_      :	Dict							=						task_specific_params[F"""summarization_{dataset}"""]['max_position_embeddings']
       a_      :	Union[str, Any]							=						PegasusTokenizer.from_pretrained('sshleifer/pegasus'						,					model_max_length=__A       )
       assert tok.model_max_length == desired_max_model_length
       tok.save_pretrained(__A       )

       # convert model
       a_      :	List[Any]							=						get_tf_weights_as_numpy(__A       )
       a_      :	List[str]							=						task_specific_params[F"""summarization_{dataset}"""]
       if dataset == "large":
              a_      :	Union[str, Any]							=						task_specific_params
       a_      :	Optional[int]							=						convert_pegasus(__A						,					__A       )
       torch_model.save_pretrained(__A       )
       a_      :	Dict							=						torch_model.state_dict()
       sd.pop('model.decoder.embed_positions.weight'       )
       sd.pop('model.encoder.embed_positions.weight'       )
       torch.save(__A						,					Path(__A       ) / 'pytorch_model.bin'       )


if __name__ == "__main__":
   UpperCAmelCase_   :				Dict						      = argparse.ArgumentParser()
   # Required parameters
   parser.add_argument('tf_ckpt_path', type=str, help='passed to tf.train.list_variables')
   parser.add_argument('save_dir', default=None, type=str, help='Path to the output PyTorch model.')
   UpperCAmelCase_   :				str						      = parser.parse_args()
   if args.save_dir is None:
      UpperCAmelCase_   :				str						      = Path(args.tf_ckpt_path).parent.name
      UpperCAmelCase_   :				Optional[int]						      = os.path.join('pegasus', dataset)
   convert_pegasus_ckpt_to_pytorch(args.tf_ckpt_path, args.save_dir)


