Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -205,6 +205,9 @@ def infer(ref_style_file, style_description, caption, progress):
|
|
| 205 |
sampled_b = sampled_b
|
| 206 |
sampled = models_b.stage_a.decode(sampled_b).float()
|
| 207 |
|
|
|
|
|
|
|
|
|
|
| 208 |
progress(0.9, "Finalizing the output image")
|
| 209 |
sampled = torch.cat([
|
| 210 |
torch.nn.functional.interpolate(ref_style.cpu(), size=(height, width)),
|
|
@@ -327,6 +330,9 @@ def infer_compo(style_description, ref_style_file, caption, ref_sub_file, progre
|
|
| 327 |
sampled_b = sampled_b
|
| 328 |
sampled = models_b.stage_a.decode(sampled_b).float()
|
| 329 |
|
|
|
|
|
|
|
|
|
|
| 330 |
progress(0.9, "Finalizing the output image")
|
| 331 |
sampled = torch.cat([
|
| 332 |
torch.nn.functional.interpolate(ref_images.cpu(), size=(height, width)),
|
|
|
|
| 205 |
sampled_b = sampled_b
|
| 206 |
sampled = models_b.stage_a.decode(sampled_b).float()
|
| 207 |
|
| 208 |
+
torch.cuda.empty_cache()
|
| 209 |
+
gc.collect()
|
| 210 |
+
|
| 211 |
progress(0.9, "Finalizing the output image")
|
| 212 |
sampled = torch.cat([
|
| 213 |
torch.nn.functional.interpolate(ref_style.cpu(), size=(height, width)),
|
|
|
|
| 330 |
sampled_b = sampled_b
|
| 331 |
sampled = models_b.stage_a.decode(sampled_b).float()
|
| 332 |
|
| 333 |
+
torch.cuda.empty_cache()
|
| 334 |
+
gc.collect()
|
| 335 |
+
|
| 336 |
progress(0.9, "Finalizing the output image")
|
| 337 |
sampled = torch.cat([
|
| 338 |
torch.nn.functional.interpolate(ref_images.cpu(), size=(height, width)),
|