Loser
Browse files
App/Generate/database/Model.py
CHANGED
|
@@ -9,7 +9,8 @@ import aiohttp
|
|
| 9 |
from typing import List
|
| 10 |
from pydantic import BaseModel
|
| 11 |
import json
|
| 12 |
-
|
|
|
|
| 13 |
database_url = SUPABASE
|
| 14 |
database = databases.Database(database_url)
|
| 15 |
models = orm.ModelRegistry(database=database)
|
|
@@ -177,9 +178,10 @@ class Scene(orm.Model):
|
|
| 177 |
}
|
| 178 |
|
| 179 |
async def generate_scene_transcript(self, offset):
|
|
|
|
| 180 |
links = [self.narration_link]
|
| 181 |
text = self.narration + " master"
|
| 182 |
-
transcript = await
|
| 183 |
return transform_alignment_data(data=transcript, offset=offset)
|
| 184 |
|
| 185 |
async def generate_scene_data(self):
|
|
@@ -193,11 +195,11 @@ class Scene(orm.Model):
|
|
| 193 |
self.narration_link = link
|
| 194 |
|
| 195 |
async def _retry_narration_generation(self):
|
| 196 |
-
|
| 197 |
retry_count = 0
|
| 198 |
while retry_count < 3:
|
| 199 |
try:
|
| 200 |
-
return await
|
| 201 |
text=self.narration + " master"
|
| 202 |
) ### The blanks help to even stuff up.
|
| 203 |
except Exception as e:
|
|
|
|
| 9 |
from typing import List
|
| 10 |
from pydantic import BaseModel
|
| 11 |
import json
|
| 12 |
+
|
| 13 |
+
SUPABASE = os.environ.get("SUPABASE", "RANDOM_STRING")
|
| 14 |
database_url = SUPABASE
|
| 15 |
database = databases.Database(database_url)
|
| 16 |
models = orm.ModelRegistry(database=database)
|
|
|
|
| 178 |
}
|
| 179 |
|
| 180 |
async def generate_scene_transcript(self, offset):
|
| 181 |
+
tts = Speak()
|
| 182 |
links = [self.narration_link]
|
| 183 |
text = self.narration + " master"
|
| 184 |
+
transcript = await tts._make_transcript(links=links, text=text)
|
| 185 |
return transform_alignment_data(data=transcript, offset=offset)
|
| 186 |
|
| 187 |
async def generate_scene_data(self):
|
|
|
|
| 195 |
self.narration_link = link
|
| 196 |
|
| 197 |
async def _retry_narration_generation(self):
|
| 198 |
+
tts = Speak()
|
| 199 |
retry_count = 0
|
| 200 |
while retry_count < 3:
|
| 201 |
try:
|
| 202 |
+
return await tts.say(
|
| 203 |
text=self.narration + " master"
|
| 204 |
) ### The blanks help to even stuff up.
|
| 205 |
except Exception as e:
|