sebbe60 commited on
Commit
c5c50a9
·
verified ·
1 Parent(s): b9126bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -68,7 +68,11 @@ def _run_inference(image: Image.Image) -> list[dict[str, object]]:
68
  return [detector.predict(image).as_dict() for detector in detectors]
69
 
70
 
71
- run_inference = spaces.GPU(duration=120)(_run_inference) if spaces is not None else _run_inference
 
 
 
 
72
 
73
 
74
  @app.post("/v1/detect")
 
68
  return [detector.predict(image).as_dict() for detector in detectors]
69
 
70
 
71
+ run_inference = (
72
+ spaces.GPU(duration=120)(_run_inference)
73
+ if spaces is not None and os.getenv("USE_ZEROGPU", "false").lower() == "true"
74
+ else _run_inference
75
+ )
76
 
77
 
78
  @app.post("/v1/detect")