Spaces:
Sleeping
Sleeping
apolinario
commited on
Commit
•
e38d64b
1
Parent(s):
9619759
Import from Huggingface_hub
Browse files- app.py +3 -2
- requirements.txt +2 -1
app.py
CHANGED
@@ -8,8 +8,9 @@ sys.path.append('./taming-transformers')
|
|
8 |
sys.path.append('./latent-diffusion')
|
9 |
from taming.models import vqgan
|
10 |
from ldm.util import instantiate_from_config
|
|
|
11 |
|
12 |
-
|
13 |
|
14 |
#@title Import stuff
|
15 |
import argparse, os, sys, glob
|
@@ -91,7 +92,7 @@ def is_unsafe(safety_model, embeddings, threshold=0.5):
|
|
91 |
return True if x > threshold else False
|
92 |
|
93 |
config = OmegaConf.load("latent-diffusion/configs/latent-diffusion/txt2img-1p4B-eval.yaml")
|
94 |
-
model = load_model_from_config(config,
|
95 |
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
|
96 |
model = model.to(device)
|
97 |
|
|
|
8 |
sys.path.append('./latent-diffusion')
|
9 |
from taming.models import vqgan
|
10 |
from ldm.util import instantiate_from_config
|
11 |
+
from huggingface_hub import hf_hub_download
|
12 |
|
13 |
+
model_path_e = hf_hub_download(repo_id="multimodalart/compvis-latent-diffusion-text2img-large", filename="txt2img-f8-large.ckpt")
|
14 |
|
15 |
#@title Import stuff
|
16 |
import argparse, os, sys, glob
|
|
|
92 |
return True if x > threshold else False
|
93 |
|
94 |
config = OmegaConf.load("latent-diffusion/configs/latent-diffusion/txt2img-1p4B-eval.yaml")
|
95 |
+
model = load_model_from_config(config,model_path_e)
|
96 |
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
|
97 |
model = model.to(device)
|
98 |
|
requirements.txt
CHANGED
@@ -14,4 +14,5 @@ numpy
|
|
14 |
tqdm
|
15 |
torchvision
|
16 |
Pillow
|
17 |
-
autokeras
|
|
|
|
14 |
tqdm
|
15 |
torchvision
|
16 |
Pillow
|
17 |
+
autokeras
|
18 |
+
huggingface_hub
|