CoolFace
Apppublic

xdecoder/Instruct-X-Decoder

sourceHugging Faceafl-3.0updated 3y agoView on Hugging Face
163likes
misc.cpython-38.pyc11 linesDownload Raw Back to __pycache__
1U

2E$�c��@s6ddlZddlZdd�Zd3dd�ZGdd	�d	e�ZdS)�NcQCs�ddddddddd	d4ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQgQ}|S)RNz{}.za photo of a {}.za bad photo of a {}.za photo of many {}.za sculpture of a {}.za photo of the hard to see {}.z!a low resolution photo of the {}.za rendering of a {}.zgraffiti of a {}.za bad photo of the {}.za cropped photo of the {}.za tattoo of a {}.zthe embroidered {}.za photo of a hard to see {}.za bright photo of a {}.za photo of a clean {}.za photo of a dirty {}.za dark photo of the {}.za drawing of a {}.za photo of my {}.zthe plastic {}.za photo of the cool {}.za close-up photo of a {}.z"a black and white photo of the {}.za painting of the {}.za painting of a {}.za pixelated photo of the {}.za sculpture of the {}.za bright photo of the {}.za cropped photo of a {}.z
a plastic {}.za photo of the dirty {}.za jpeg corrupted photo of a {}.za blurry photo of the {}.za photo of the {}.za good photo of the {}.za rendering of the {}.za {} in a video game.za photo of one {}.za doodle of a {}.za close-up photo of the {}.zthe origami {}.zthe {} in a video game.za sketch of a {}.za doodle of the {}.z
a origami {}.za low resolution photo of a {}.zthe toy {}.za rendition of the {}.za photo of the clean {}.za photo of a large {}.za rendition of a {}.za photo of a nice {}.za photo of a weird {}.za blurry photo of a {}.z
a cartoon {}.zart of a {}.za sketch of the {}.za embroidered {}.za pixelated photo of a {}.zitap of the {}.z!a jpeg corrupted photo of the {}.za good photo of a {}.z
a plushie {}.za photo of the nice {}.za photo of the small {}.za photo of the weird {}.zthe cartoon {}.zart of the {}.za drawing of the {}.za photo of the large {}.z a black and white photo of a {}.zthe plushie {}.za dark photo of a {}.z
itap of a {}.zgraffiti of the {}.z	a toy {}.zitap of my {}.za photo of a cool {}.za photo of a small {}.za tattoo of the {}.�)�prompt_templatesrr�#/data/arXiv/demo/Demo/utils/misc.py�get_prompt_templatess��Sr��.cCs\t�}tj�tt|�|��}t|t�r2t�|�}n|}||�	d|��5|�	dd��	dd��S)Nr�,��+� )r�np�random�randint�min�len�6isinstance�list�choice�replace�format)�7classnames�topk�suffixrZtemp_idx�	classnamerrr�prompt_engineering[s8rc@s*eZdZdZdd�Zdd�Zddd	�Zd9S)�AverageMeterz2Computes and stores the average and current value.cCs|��dS)N)�reset��selfrrr�__init__hszAverageMeter.__init__cCsd|_d|_d|_d|_dS)Nr)�val�avg�sum�countrrrrrkszAverageMeter.resetrrcCs�||_|rPt�||�}||jd||||_||jd|||_n |j||7_|j|7_|j|j|_dS)Nr)r �math�expr"r#r!)rr �n�decay�alpharrr�updateqszAverageMeter.updateN)rr)�__name__�10__module__�__qualname__�__doc__rrr)rrrrrfsr)rr)r$�numpyrrr�objectrrrrr�<module>sW11