Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
| 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)
|