Ahsen Khaliq commited on
Commit
20f9740
Β·
1 Parent(s): 408fc5d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -338,6 +338,11 @@ def load_image( infilename ) :
338
  data = np.asarray( img, dtype="int32" )
339
  return data
340
  def throttled_inference(text, seed, step_size, max_iterations, width, height):
 
 
 
 
 
341
  global inferences_running
342
  current = inferences_running
343
  if current >= 2:
 
338
  data = np.asarray( img, dtype="int32" )
339
  return data
340
  def throttled_inference(text, seed, step_size, max_iterations, width, height):
341
+ t = torch.cuda.get_device_properties(0).total_memory
342
+ r = torch.cuda.memory_reserved(0)
343
+ a = torch.cuda.memory_allocated(0)
344
+ f = r-a # free inside reserved
345
+ print(f)
346
  global inferences_running
347
  current = inferences_running
348
  if current >= 2: