@@ -585,22 +585,16 @@ async def route_general_transcriptions(
585
585
586
586
endpoints = service_discovery .get_endpoint_info ()
587
587
588
- logger .debug ("==== Total endpoints ====" )
589
- logger .debug (endpoints )
590
- logger .debug ("==== Total endpoints ====" )
591
-
592
- # filter the endpoints url by model name and label for transcriptions
593
- transcription_endpoints = [
594
- ep
595
- for ep in endpoints
596
- if model == ep .model_name
597
- and ep .model_label == "transcription"
598
- and not ep .sleep # Added ep.sleep == False
599
- ]
600
-
601
- logger .debug ("====List of transcription endpoints====" )
602
- logger .debug (transcription_endpoints )
603
- logger .debug ("====List of transcription endpoints====" )
588
+ # filter the endpoints url by model name and model label for transcriptions
589
+ transcription_endpoints = []
590
+ for ep in endpoints :
591
+ for model_name in ep .model_names :
592
+ if (
593
+ model == model_name
594
+ and ep .model_label == "transcription"
595
+ and not ep .sleep
596
+ ):
597
+ transcription_endpoints .append (ep )
604
598
605
599
if not transcription_endpoints :
606
600
logger .error ("No transcription backend available for model %s" , model )
@@ -640,10 +634,6 @@ async def route_general_transcriptions(
640
634
641
635
logger .info ("Proxying transcription request for model %s to %s" , model , chosen_url )
642
636
643
- logger .debug ("==== data payload keys ====" )
644
- logger .debug (list (data .keys ()))
645
- logger .debug ("==== data payload keys ====" )
646
-
647
637
try :
648
638
client = request .app .state .aiohttp_client_wrapper ()
649
639
@@ -707,3 +697,9 @@ async def route_general_transcriptions(
707
697
status_code = 503 ,
708
698
content = {"error" : f"Failed to connect to backend: { str (client_error )} " },
709
699
)
700
+ except Exception as e :
701
+ logger .error (e )
702
+ return JSONResponse (
703
+ status_code = 500 ,
704
+ content = {"error" : "Internal server error" },
705
+ )
0 commit comments