m7n commited on
Commit
4293529
·
1 Parent(s): 2d03333

add spaces import

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -87,9 +87,13 @@ is_running_in_hf_zero_gpu()
87
  def is_running_in_hf_space():
88
  return "SPACE_ID" in os.environ
89
 
90
- if is_running_in_hf_space():
91
- import spaces # necessary to run on Zero.
92
- from spaces.zero.client import _get_token
 
 
 
 
93
 
94
  #if is_running_in_hf_space():
95
  #import spaces # necessary to run on Zero.
 
87
  def is_running_in_hf_space():
88
  return "SPACE_ID" in os.environ
89
 
90
+ #if is_running_in_hf_space():
91
+ import spaces # necessary to run on Zero.
92
+ from spaces.zero.client import _get_token
93
+
94
+
95
+ @spaces.GPU(duration=1) # ← forces the detector to see a GPU-aware fn
96
+ def _warmup(): pass
97
 
98
  #if is_running_in_hf_space():
99
  #import spaces # necessary to run on Zero.