Spaces:
Sleeping
Sleeping
Commit
·
d0b9734
1
Parent(s):
c99a3fd
Fix: add startup delay for MCP race condition
Browse files
app.py
CHANGED
|
@@ -103,4 +103,12 @@ async def extract_slidepack(file: UploadFile):
|
|
| 103 |
return analyze_slidepack(type("File", (object,), {"name": path}))
|
| 104 |
|
| 105 |
if __name__ == "__main__":
|
| 106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
return analyze_slidepack(type("File", (object,), {"name": path}))
|
| 104 |
|
| 105 |
if __name__ == "__main__":
|
| 106 |
+
import asyncio
|
| 107 |
+
|
| 108 |
+
async def delayed_startup():
|
| 109 |
+
print("⏳ Waiting before MCP launch to avoid race condition...")
|
| 110 |
+
await asyncio.sleep(3) # wait 3 seconds to allow models to finish loading
|
| 111 |
+
print("🚀 Launching with MCP support now.")
|
| 112 |
+
demo.launch(mcp_server=True)
|
| 113 |
+
|
| 114 |
+
asyncio.run(delayed_startup())
|