
"""simple docstring"""




import requests

A__      :	Optional[int]          =    """YOUR API KEY"""



def 							a__ (				lowerCAmelCase	:       str       ,    lowerCAmelCase	:       str = giphy_api_key		):






     '''simple docstring'''
     UpperCAmelCase__							: str 							=						"+".join(query.split()		)
     UpperCAmelCase__							: Dict 							=						F"https://api.giphy.com/v1/gifs/search?q={formatted_query}&api_key={api_key}"
     UpperCAmelCase__							: List[Any] 							=						requests.get(lowerCAmelCase		).json()["data"]
     return [gif["url"] for gif in gifs]


if __name__ == "__main__":
    print("""\n""".join(get_gifs("""space ship""")))





"""simple docstring"""




import argparse
import os

import torch

from transformers.utils import WEIGHTS_NAME


A__      :	Optional[int]          =    ["""small""", """medium""", """large"""]

A__      :	Optional[int]          =    """lm_head.decoder.weight"""
A__      :	Dict          =    """lm_head.weight"""



def 							a__ (				lowerCAmelCase	:       str       ,    lowerCAmelCase	:       str		):






     '''simple docstring'''
     UpperCAmelCase__							: Dict 							=						torch.load(lowerCAmelCase		)
     UpperCAmelCase__							: Optional[int] 							=						d.pop(lowerCAmelCase		)
     os.makedirs(lowerCAmelCase       ,    exist_ok=lowerCAmelCase		)
     torch.save(lowerCAmelCase       ,    os.path.join(lowerCAmelCase       ,    lowerCAmelCase		)		)


if __name__ == "__main__":
    A__      :	List[Any]          =    argparse.ArgumentParser()
    parser.add_argument("""--dialogpt_path""", default=""".""", type=str)
    A__      :	Tuple          =    parser.parse_args()
    for MODEL in DIALOGPT_MODELS:
        A__      :	Tuple          =    os.path.join(args.dialogpt_path, f"""{MODEL}_ft.pkl""")
        A__      :	str          =    f"""./DialoGPT-{MODEL}"""
        convert_dialogpt_checkpoint(
            checkpoint_path,
            pytorch_dump_folder_path,
        )



