Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -502,7 +502,9 @@ SUPABASE_URL = "https://kvlxvhdgacktsgykyckm.supabase.co/"
|
|
| 502 |
SUPABASE_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imt2bHh2aGRnYWNrdHNneWt5Y2ttIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc3MTk2MTQ5MSwiZXhwIjoyMDg3NTM3NDkxfQ.tzfHcbzwzctHDDDp3vk4JGz30ajN2szncAV-1wK7_pM"
|
| 503 |
supabase: Client = create_client(SUPABASE_URL, SUPABASE_KEY)
|
| 504 |
|
|
|
|
| 505 |
async def run_tts_pipeline(task_id: str, story: StoryCreationDTO):
|
|
|
|
| 506 |
try:
|
| 507 |
# 1️⃣ Generate story audios
|
| 508 |
await generate_story_audios(story, base_output=OUTPUT_DIR)
|
|
@@ -560,6 +562,11 @@ async def run_tts_pipeline(task_id: str, story: StoryCreationDTO):
|
|
| 560 |
}
|
| 561 |
}
|
| 562 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 563 |
except Exception as e:
|
| 564 |
print(f"exception caught at run tts pipeline {str(e)}")
|
| 565 |
tasks[task_id] = {
|
|
|
|
| 502 |
SUPABASE_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imt2bHh2aGRnYWNrdHNneWt5Y2ttIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc3MTk2MTQ5MSwiZXhwIjoyMDg3NTM3NDkxfQ.tzfHcbzwzctHDDDp3vk4JGz30ajN2szncAV-1wK7_pM"
|
| 503 |
supabase: Client = create_client(SUPABASE_URL, SUPABASE_KEY)
|
| 504 |
|
| 505 |
+
import time
|
| 506 |
async def run_tts_pipeline(task_id: str, story: StoryCreationDTO):
|
| 507 |
+
start_time = time.time() # start timer
|
| 508 |
try:
|
| 509 |
# 1️⃣ Generate story audios
|
| 510 |
await generate_story_audios(story, base_output=OUTPUT_DIR)
|
|
|
|
| 562 |
}
|
| 563 |
}
|
| 564 |
|
| 565 |
+
# --- Print processing time ---
|
| 566 |
+
end_time = time.time()
|
| 567 |
+
elapsed = end_time - start_time
|
| 568 |
+
print(f"Story {story.storyId} processed in {elapsed:.2f} seconds")
|
| 569 |
+
|
| 570 |
except Exception as e:
|
| 571 |
print(f"exception caught at run tts pipeline {str(e)}")
|
| 572 |
tasks[task_id] = {
|