@@ -565,18 +565,13 @@ async def route_general_transcriptions(
565
565
566
566
endpoints = service_discovery .get_endpoint_info ()
567
567
568
- logger .debug ("==== Total endpoints ====" )
569
- logger .debug (endpoints )
570
- logger .debug ("==== Total endpoints ====" )
571
-
572
568
# filter the endpoints url by model name and label for transcriptions
573
- transcription_endpoints = [
574
- ep
575
- for ep in endpoints
576
- if model == ep .model_name
577
- and ep .model_label == "transcription"
578
- and not ep .sleep # Added ep.sleep == False
579
- ]
569
+ logger .debug (endpoints )
570
+ transcription_endpoints = []
571
+ for ep in endpoints :
572
+ for model_name in ep .model_names :
573
+ if model == model_name and ep .model_type == "transcription" and not ep .sleep :
574
+ transcription_endpoints .append (ep )
580
575
581
576
logger .debug ("====List of transcription endpoints====" )
582
577
logger .debug (transcription_endpoints )
@@ -620,10 +615,6 @@ async def route_general_transcriptions(
620
615
621
616
logger .info ("Proxying transcription request for model %s to %s" , model , chosen_url )
622
617
623
- logger .debug ("==== data payload keys ====" )
624
- logger .debug (list (data .keys ()))
625
- logger .debug ("==== data payload keys ====" )
626
-
627
618
try :
628
619
client = request .app .state .aiohttp_client_wrapper ()
629
620
@@ -687,3 +678,9 @@ async def route_general_transcriptions(
687
678
status_code = 503 ,
688
679
content = {"error" : f"Failed to connect to backend: { str (client_error )} " },
689
680
)
681
+ except Exception as e :
682
+ logger .error (e )
683
+ return JSONResponse (
684
+ status_code = 500 ,
685
+ content = {"error" : f"Internal server error" },
686
+ )
0 commit comments