Spaces:
Runtime error
Runtime error
fix phase2 timeout
Browse files- inference.py +12 -0
inference.py
CHANGED
|
@@ -135,3 +135,15 @@ except Exception:
|
|
| 135 |
"[END] success=false steps=0 score=0.00 rewards=",
|
| 136 |
flush=True
|
| 137 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
"[END] success=false steps=0 score=0.00 rewards=",
|
| 136 |
flush=True
|
| 137 |
)
|
| 138 |
+
# Keep server alive for reset endpoint
|
| 139 |
+
import threading
|
| 140 |
+
|
| 141 |
+
def keep_alive():
|
| 142 |
+
while True:
|
| 143 |
+
time.sleep(60)
|
| 144 |
+
|
| 145 |
+
threading.Thread(target=keep_alive, daemon=True).start()
|
| 146 |
+
|
| 147 |
+
# keep main thread alive
|
| 148 |
+
while True:
|
| 149 |
+
time.sleep(60)
|