Spaces:
Runtime error
Runtime error
Mehdi Cherti
commited on
Commit
•
af5ee77
1
Parent(s):
b5b3814
update
Browse files
app.py
CHANGED
@@ -14,6 +14,7 @@ def download(filename):
|
|
14 |
url = f"https://huggingface.co/spaces/mehdidc/text_to_image_ddgan/raw/main/models/{filename}"
|
15 |
if not os.path.exists(filename):
|
16 |
call("wget -O {filename} {url}".format(filename=filename, url=url), shell=True)
|
|
|
17 |
return filename
|
18 |
|
19 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
@@ -35,7 +36,9 @@ models = {
|
|
35 |
default = "diffusion_db_128ch_1timesteps_openclip_vith14"
|
36 |
|
37 |
def gen(md, model_name, md2, text, seed, nb_samples, width, height):
|
|
|
38 |
model = load(model_name)
|
|
|
39 |
torch.manual_seed(int(seed))
|
40 |
nb_samples = int(nb_samples)
|
41 |
height = int(height)
|
|
|
14 |
url = f"https://huggingface.co/spaces/mehdidc/text_to_image_ddgan/raw/main/models/{filename}"
|
15 |
if not os.path.exists(filename):
|
16 |
call("wget -O {filename} {url}".format(filename=filename, url=url), shell=True)
|
17 |
+
call("ls models -l", shell=True)
|
18 |
return filename
|
19 |
|
20 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
|
|
36 |
default = "diffusion_db_128ch_1timesteps_openclip_vith14"
|
37 |
|
38 |
def gen(md, model_name, md2, text, seed, nb_samples, width, height):
|
39 |
+
print("load ", model_name)
|
40 |
model = load(model_name)
|
41 |
+
print(model)
|
42 |
torch.manual_seed(int(seed))
|
43 |
nb_samples = int(nb_samples)
|
44 |
height = int(height)
|