pvanand commited on
Commit
8028cc0
1 Parent(s): 72440bd

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -1
main.py CHANGED
@@ -552,7 +552,10 @@ async def text_to_speech_v2(request: AudioAPI.TTSRequest, api_key: str = Depends
552
  response_format="mp3" # Always set to MP3
553
  )
554
 
555
- return StreamingResponse(io.BytesIO(response.content), media_type="audio/mp3")
 
 
 
556
  # try:
557
  # response = openai_client.audio.speech.create(
558
  # model=request.model,
 
552
  response_format="mp3" # Always set to MP3
553
  )
554
 
555
+ return StreamingResponse(io.BytesIO(response.content), media_type="audio/mp3")
556
+
557
+ except Exception as e:
558
+ raise HTTPException(status_code=500, detail=str(e))
559
  # try:
560
  # response = openai_client.audio.speech.create(
561
  # model=request.model,