Update app.py
Browse files
app.py
CHANGED
|
@@ -418,4 +418,11 @@ with gr.Blocks() as demo:
|
|
| 418 |
)
|
| 419 |
|
| 420 |
if __name__ == "__main__" or os.getenv("SYSTEM") == "spaces":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 421 |
demo.launch()
|
|
|
|
| 418 |
)
|
| 419 |
|
| 420 |
if __name__ == "__main__" or os.getenv("SYSTEM") == "spaces":
|
| 421 |
+
if __name__ == "__main__" or os.getenv("SYSTEM") == "spaces":
|
| 422 |
+
try:
|
| 423 |
+
load_model() # triggers GPU allocation during startup
|
| 424 |
+
except Exception as e:
|
| 425 |
+
# don't crash the app if warmup fails; logs will show details
|
| 426 |
+
print("Warmup failed:", e)
|
| 427 |
+
|
| 428 |
demo.launch()
|