ZhengPeng7 commited on
Commit
5373741
1 Parent(s): 43d2091

Make the runtime counter var global.

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -68,7 +68,7 @@ def predict(image, resolution, weights_file):
68
  global birefnet
69
  # Load BiRefNet with chosen weights
70
  _weights_file = '/'.join(('zhengpeng7', usage_to_weights_file[weights_file] if weights_file is not None else usage_to_weights_file['General']))
71
- counter_runtime += 1
72
  print('Using weights: {} in runtime {}'.format(_weights_file, counter_runtime))
73
  birefnet = AutoModelForImageSegmentation.from_pretrained(_weights_file, trust_remote_code=True)
74
  birefnet.to(device)
 
68
  global birefnet
69
  # Load BiRefNet with chosen weights
70
  _weights_file = '/'.join(('zhengpeng7', usage_to_weights_file[weights_file] if weights_file is not None else usage_to_weights_file['General']))
71
+ global counter_runtime; counter_runtime += 1
72
  print('Using weights: {} in runtime {}'.format(_weights_file, counter_runtime))
73
  birefnet = AutoModelForImageSegmentation.from_pretrained(_weights_file, trust_remote_code=True)
74
  birefnet.to(device)