mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
fix transcription exception handling - /audio/transcriptions (#16791)
* fix transcription exception handling * reraise the exception
This commit is contained in:
parent
5cb5c2a7b7
commit
6e5c7c0008
1 changed files with 2 additions and 1 deletions
|
|
@ -5483,6 +5483,7 @@ async def audio_transcriptions(
|
|||
file_object = io.BytesIO(file_content)
|
||||
file_object.name = file.filename
|
||||
data["file"] = file_object
|
||||
|
||||
try:
|
||||
### CALL HOOKS ### - modify incoming data / reject request before calling the model
|
||||
data = await proxy_logging_obj.pre_call_hook(
|
||||
|
|
@ -5500,7 +5501,7 @@ async def audio_transcriptions(
|
|||
)
|
||||
response = await llm_call
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
raise e
|
||||
finally:
|
||||
file_object.close() # close the file read in by io library
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue