CircleStar commited on
Commit
78038de
·
verified ·
1 Parent(s): 7b7175d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -26,7 +26,8 @@ os.makedirs(DATA_DIR, exist_ok=True)
26
  os.makedirs(MODEL_DIR, exist_ok=True)
27
  os.makedirs(META_DIR, exist_ok=True)
28
 
29
- DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
 
30
  CLASS_NAMES = [str(i) for i in range(10)]
31
 
32
 
@@ -513,4 +514,4 @@ with gr.Blocks(title="Image Classification") as demo:
513
 
514
 
515
  if __name__ == "__main__":
516
- demo.launch()
 
26
  os.makedirs(MODEL_DIR, exist_ok=True)
27
  os.makedirs(META_DIR, exist_ok=True)
28
 
29
+ # Force CPU on Hugging Face Spaces for this lightweight demo
30
+ DEVICE = torch.device("cpu")
31
  CLASS_NAMES = [str(i) for i in range(10)]
32
 
33
 
 
514
 
515
 
516
  if __name__ == "__main__":
517
+ demo.launch(ssr_mode=False)