CORVO-AI commited on
Commit
6d7b203
·
verified ·
1 Parent(s): 3747525

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -505,6 +505,14 @@ def transcribe_endpoint():
505
  GLOBAL_BOT_ID = updated_bot_id
506
  GLOBAL_WORKSPACE_ID = updated_workspace_id
507
 
 
 
 
 
 
 
 
 
508
  return jsonify({"transcription": transcription})
509
 
510
 
 
505
  GLOBAL_BOT_ID = updated_bot_id
506
  GLOBAL_WORKSPACE_ID = updated_workspace_id
507
 
508
+ # Check if we got an error string back
509
+ if isinstance(transcription, str) and (
510
+ transcription.startswith("Failed") or
511
+ transcription.startswith("Unable") or
512
+ transcription.startswith("The transcription is taking too long")
513
+ ):
514
+ return jsonify({"error": transcription}), 500
515
+
516
  return jsonify({"transcription": transcription})
517
 
518