This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
from typing import List, Optional, Union, Tuple | |
import numpy as np | |
import torch | |
from PIL import Image | |
from diffusers import ( | |
AutoencoderKL, | |
DDIMScheduler, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from typing import List | |
import numpy as np | |
import torch | |
from cog import BasePredictor, Input, Path | |
from diffusers import ( | |
AutoencoderKL, | |
LMSDiscreteScheduler, | |
UNet2DConditionModel, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
"t-shirt, size M", | |
"flower dress, size M", | |
"a t-shirt of an avocado", | |
"a rainbow hat", | |
"white snow covered mountain under blue sky during daytime", | |
"aerial view of the beach during daytime", | |
"aerial view of the beach at night", | |
"double rainbow over a lake", | |
"a beautiful sunset at a beach with a shell on the shore", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
from datetime import datetime | |
import replicate | |
import asyncio | |
import logging | |
logging.basicConfig(level=logging.INFO) | |
import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pathlib | |
from csv import writer | |
import torch | |
import tqdm | |
from PIL import Image | |
from torch.utils.data import Dataset | |
from torchvision import transforms | |
from torchvision.transforms.functional import InterpolationMode | |
from data import create_loader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://wandb.ai/afiaka87/glide_finetune/runs/3fj69lfc?workspace=user-afiaka87 | |
from lzma import MODE_NORMAL | |
from PIL import Image | |
import os | |
import wandb | |
from IPython.display import display | |
import torch as th | |
from glide_text2im import xf | |
from glide_text2im.download import load_checkpoint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#%% | |
# cd Detic/ | |
# %% | |
import detectron2 | |
from detectron2.utils.logger import setup_logger | |
from pathlib import Path | |
from random import randint, choice | |
import time | |
import PIL | |
from PIL import Image |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
an illustration of a bunny in a beanie sipping a latte | |
a small red book sitting on a large green book | |
a black and white photograph of a fox sitting on a mountain during spring | |
a poster of a cougar sitting on a mountain during summer | |
an illustration of a baby penguin in a leather jacket using a calculator | |
a pencil sketch of a pangolin sitting on a mountain at dawn | |
a professional high quality illustration of a pig isopod chimera. a pig imitating an isopod. a pig made of isopod. | |
a rug with an image of a pink cucumber | |
an emoji of a baby fox wearing a red hat, green gloves, yellow shirt, and blue pants |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import sys | |
sys.path.append("./glide-text2im") | |
import torch as th | |
from glide_text2im.download import load_checkpoint | |
from glide_text2im.model_creation import (create_model_and_diffusion, | |
model_and_diffusion_defaults) | |
from guided_diffusion import dist_util, logger | |
from guided_diffusion.image_text_datasets import load_data | |
from guided_diffusion.resample import create_named_schedule_sampler |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
number_regex = re.compile(r'[0-9]{5,}') | |
date_regex = re.compile(r'[0-9]{4}-[0-9]{2}-[0-9]{2}') | |
url_regex = re.compile(r'https?://[^\s]+') | |
@lru_cache(maxsize=32) | |
def tokenize(s): | |
s = s.decode('utf-8') | |
s = s.lower() | |
s = number_regex.sub('', s) |
NewerOlder