Podtekatel commited on
Commit
bb610db
1 Parent(s): f02b231

Added queue and usage count for debug

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -16,6 +16,7 @@ logging.basicConfig(
16
  datefmt='%Y-%m-%d %H:%M:%S')
17
 
18
  MODEL_IMG_SIZE = 256
 
19
  def load_model():
20
  REPO_ID = "Podtekatel/ARCNEGAN"
21
  FILENAME_OLD = "arcane_exp_203_ep_399.onnx"
@@ -54,6 +55,9 @@ def inference(img, ver):
54
  out_img = pipeline_old(img)
55
 
56
  out_img = Image.fromarray(out_img)
 
 
 
57
  return out_img
58
 
59
 
@@ -79,5 +83,5 @@ demo = gr.Interface(
79
  description=description,
80
  article=article,
81
  examples=examples)
82
-
83
  demo.launch()
 
16
  datefmt='%Y-%m-%d %H:%M:%S')
17
 
18
  MODEL_IMG_SIZE = 256
19
+ usage_count = 0
20
  def load_model():
21
  REPO_ID = "Podtekatel/ARCNEGAN"
22
  FILENAME_OLD = "arcane_exp_203_ep_399.onnx"
 
55
  out_img = pipeline_old(img)
56
 
57
  out_img = Image.fromarray(out_img)
58
+ global usage_count
59
+ usage_count += 1
60
+ logging.info(f'Usage count is {usage_count}')
61
  return out_img
62
 
63
 
 
83
  description=description,
84
  article=article,
85
  examples=examples)
86
+ demo.queue(concurrency_count=1)
87
  demo.launch()