Update app.py
Browse files
app.py
CHANGED
@@ -230,5 +230,7 @@ async def root():
|
|
230 |
if __name__ == "__main__":
|
231 |
initialize_redis()
|
232 |
import asyncio
|
233 |
-
|
234 |
-
|
|
|
|
|
|
230 |
if __name__ == "__main__":
|
231 |
initialize_redis()
|
232 |
import asyncio
|
233 |
+
uvicorn.run(app, host="0.0.0.0", port=7860) # Start Uvicorn first
|
234 |
+
|
235 |
+
loop = asyncio.get_event_loop() # Get the current event loop
|
236 |
+
loop.create_task(train_and_save_model()) # Create the training task within the loop
|