Mbonea commited on
Commit
bb47392
1 Parent(s): c3d9864

generate_scene_data

Browse files
Files changed (1) hide show
  1. App/Generate/database/Model.py +21 -21
App/Generate/database/Model.py CHANGED
@@ -190,11 +190,11 @@ class Scene(orm.Model):
190
  self.calculate_durations()
191
 
192
  async def narrate(self):
193
- link, path = await self._retry_narration_generation()
194
  self.narration_path = path
195
  self.narration_link = link
196
 
197
- async def _retry_narration_generation(self):
198
  print(self.narration)
199
  tts = Speak()
200
  retry_count = 0
@@ -261,26 +261,26 @@ class BackgroundMusic(orm.Model):
261
  # pass
262
 
263
 
264
- # # Create the tables
265
- async def create_tables():
266
- datas = {
267
- "narration": "Welcome to a journey through some of history's strangest moments! Get ready to explore the bizarre, the unusual, and the downright weird.",
268
- "image_prompts": [
269
- "Vintage book opening, revealing strange facts, mixed media collage, curious and intriguing, mysterious, eccentric, macro lens, soft lighting, conceptual photography, cross-processed film, surreal, warm tones, textured paper."
270
- ],
271
- }
272
 
273
- await models._create_all(database_url)
274
- x = await Project.objects.create(name="avatar")
275
- scene = await Scene.objects.create(project=x)
276
- scene.narration = datas["narration"]
277
- scene.image_prompts = datas["image_prompts"]
278
-
279
- await scene.generate_scene_data()
280
- await scene.objects.update(**scene.__dict__)
281
- p = await x.get_all_scenes()
282
- print(p)
283
- print(scene.__dict__)
284
 
285
 
286
  # asyncio.run(create_tables())
 
190
  self.calculate_durations()
191
 
192
  async def narrate(self):
193
+ link, path = await self.retry_narration_generation()
194
  self.narration_path = path
195
  self.narration_link = link
196
 
197
+ async def retry_narration_generation(self):
198
  print(self.narration)
199
  tts = Speak()
200
  retry_count = 0
 
261
  # pass
262
 
263
 
264
+ # # # Create the tables
265
+ # async def create_tables():
266
+ # datas = {
267
+ # "narration": "Welcome to a journey through some of history's strangest moments! Get ready to explore the bizarre, the unusual, and the downright weird.",
268
+ # "image_prompts": [
269
+ # "Vintage book opening, revealing strange facts, mixed media collage, curious and intriguing, mysterious, eccentric, macro lens, soft lighting, conceptual photography, cross-processed film, surreal, warm tones, textured paper."
270
+ # ],
271
+ # }
272
 
273
+ # await models._create_all(database_url)
274
+ # x = await Project.objects.create(name="avatar")
275
+ # scene = await Scene.objects.create(project=x)
276
+ # scene.narration = datas["narration"]
277
+ # scene.image_prompts = datas["image_prompts"]
278
+
279
+ # await scene.generate_scene_data()
280
+ # await scene.objects.update(**scene.__dict__)
281
+ # p = await x.get_all_scenes()
282
+ # print(p)
283
+ # print(scene.__dict__)
284
 
285
 
286
  # asyncio.run(create_tables())