Ahsen Khaliq commited on
Commit
011c077
1 Parent(s): 2e67d43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -6,6 +6,7 @@ import torch
6
  from random import randint
7
  import sys
8
  from subprocess import call
 
9
 
10
  torch.hub.download_url_to_file('https://i.imgur.com/tXrot31.jpg', 'cpu.jpg')
11
 
@@ -45,6 +46,7 @@ def inference(img):
45
 
46
  inferences_running = 0
47
  def throttled_inference(image):
 
48
  global inferences_running
49
  current = inferences_running
50
  if current >= 1:
@@ -57,6 +59,7 @@ def throttled_inference(image):
57
  finally:
58
  print("Inference finished")
59
  inferences_running -= 1
 
60
 
61
 
62
  title = "Real-ESRGAN"
 
6
  from random import randint
7
  import sys
8
  from subprocess import call
9
+ import psutil
10
 
11
  torch.hub.download_url_to_file('https://i.imgur.com/tXrot31.jpg', 'cpu.jpg')
12
 
 
46
 
47
  inferences_running = 0
48
  def throttled_inference(image):
49
+ print(psutil.virtual_memory())
50
  global inferences_running
51
  current = inferences_running
52
  if current >= 1:
 
59
  finally:
60
  print("Inference finished")
61
  inferences_running -= 1
62
+ print(psutil.virtual_memory())
63
 
64
 
65
  title = "Real-ESRGAN"