Spaces:
mikitona
/
Running on Zero

Fabrice-TIERCELIN commited on
Commit
66209b8
·
verified ·
1 Parent(s): dade92f

torch.cuda.empty_cache()

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -396,6 +396,7 @@ def restore_on_gpu(
396
  x_samples = (einops.rearrange(samples, 'b c h w -> b h w c') * 127.5 + 127.5).cpu().numpy().round().clip(
397
  0, 255).astype(np.uint8)
398
  results = [x_samples[i] for i in range(num_samples)]
 
399
 
400
  # All the results have the same size
401
  input_height, input_width, input_channel = np.array(input_image).shape
 
396
  x_samples = (einops.rearrange(samples, 'b c h w -> b h w c') * 127.5 + 127.5).cpu().numpy().round().clip(
397
  0, 255).astype(np.uint8)
398
  results = [x_samples[i] for i in range(num_samples)]
399
+ torch.cuda.empty_cache()
400
 
401
  # All the results have the same size
402
  input_height, input_width, input_channel = np.array(input_image).shape