kani1021 commited on
Commit
ec94ca0
·
1 Parent(s): 632f92d

Add ZeroGPU decorator

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -13,7 +13,10 @@ classifier = pipeline(
13
  image_processor="model",
14
  )
15
 
 
16
 
 
 
17
  def predict(image):
18
  results = classifier(image, top_k=3)
19
  return {item["label"]: item["score"] for item in results}
 
13
  image_processor="model",
14
  )
15
 
16
+ gpu = spaces.GPU if spaces else lambda fn: fn
17
 
18
+
19
+ @gpu
20
  def predict(image):
21
  results = classifier(image, top_k=3)
22
  return {item["label"]: item["score"] for item in results}