startup
Browse files- App/Generate/generatorRoutes.py +0 -7
- App/app.py +12 -4
App/Generate/generatorRoutes.py
CHANGED
@@ -18,13 +18,6 @@ async def update_scene(model_scene):
|
|
18 |
async def main(request: GeneratorRequest):
|
19 |
topic = request.prompt
|
20 |
renderr = RenderVideo()
|
21 |
-
try:
|
22 |
-
await models._create_all(database_url)
|
23 |
-
except:
|
24 |
-
pass
|
25 |
-
finally:
|
26 |
-
if not database.is_connected:
|
27 |
-
await database.connect()
|
28 |
message = chatbot(Prompt.format(topic=topic))
|
29 |
|
30 |
generated_story = Story.from_dict(message["scenes"])
|
|
|
18 |
async def main(request: GeneratorRequest):
|
19 |
topic = request.prompt
|
20 |
renderr = RenderVideo()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
message = chatbot(Prompt.format(topic=topic))
|
22 |
|
23 |
generated_story = Story.from_dict(message["scenes"])
|
App/app.py
CHANGED
@@ -2,7 +2,7 @@ from fastapi import FastAPI, BackgroundTasks
|
|
2 |
from .Editor.editorRoutes import videditor_router
|
3 |
from App import bot
|
4 |
from App.utilis import WorkerClient, SERVER_STATE
|
5 |
-
from .Generate.generatorRoutes import generator_router
|
6 |
|
7 |
app = FastAPI()
|
8 |
manager = WorkerClient()
|
@@ -10,11 +10,19 @@ manager = WorkerClient()
|
|
10 |
|
11 |
@app.on_event("startup")
|
12 |
async def startup_event():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
await bot.start()
|
14 |
-
#if SERVER_STATE.MASTER:
|
15 |
|
16 |
-
#response = await manager.register_worker()
|
17 |
-
#if not response:
|
18 |
# print("Error registering worker")
|
19 |
|
20 |
|
|
|
2 |
from .Editor.editorRoutes import videditor_router
|
3 |
from App import bot
|
4 |
from App.utilis import WorkerClient, SERVER_STATE
|
5 |
+
from .Generate.generatorRoutes import generator_router, database, database_url, models
|
6 |
|
7 |
app = FastAPI()
|
8 |
manager = WorkerClient()
|
|
|
10 |
|
11 |
@app.on_event("startup")
|
12 |
async def startup_event():
|
13 |
+
try:
|
14 |
+
await models._create_all(database_url)
|
15 |
+
except:
|
16 |
+
pass
|
17 |
+
finally:
|
18 |
+
if not database.is_connected:
|
19 |
+
await database.connect()
|
20 |
+
|
21 |
await bot.start()
|
22 |
+
# if SERVER_STATE.MASTER:
|
23 |
|
24 |
+
# response = await manager.register_worker()
|
25 |
+
# if not response:
|
26 |
# print("Error registering worker")
|
27 |
|
28 |
|