Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -134,6 +134,7 @@ def prepare_data(device, input_image, x0, y0, x1, y1, polar, azimuth, text):
|
|
134 |
def run_generation(sampler, model, device, input_image, x0, y0, x1, y1, polar, azimuth, text, seed):
|
135 |
seed_everything(seed)
|
136 |
batch = prepare_data(device, input_image, x0, y0, x1, y1, polar, azimuth, text)
|
|
|
137 |
|
138 |
c = model.get_learned_conditioning(batch["image_cond"])
|
139 |
c = torch.cat([c, batch["T"]], dim=-1)
|
@@ -185,7 +186,7 @@ def load_example(input_image, x0, y0, x1, y1, polar, azimuth, prompt):
|
|
185 |
# print(type(polar))
|
186 |
return input_image, x0, y0, x1, y1, polar, azimuth, prompt
|
187 |
|
188 |
-
|
189 |
@torch.no_grad()
|
190 |
def main(args):
|
191 |
# load model
|
|
|
134 |
def run_generation(sampler, model, device, input_image, x0, y0, x1, y1, polar, azimuth, text, seed):
|
135 |
seed_everything(seed)
|
136 |
batch = prepare_data(device, input_image, x0, y0, x1, y1, polar, azimuth, text)
|
137 |
+
model = model.to(device)
|
138 |
|
139 |
c = model.get_learned_conditioning(batch["image_cond"])
|
140 |
c = torch.cat([c, batch["T"]], dim=-1)
|
|
|
186 |
# print(type(polar))
|
187 |
return input_image, x0, y0, x1, y1, polar, azimuth, prompt
|
188 |
|
189 |
+
|
190 |
@torch.no_grad()
|
191 |
def main(args):
|
192 |
# load model
|