refac: audio transcribe supported filetype
This commit is contained in:
1 parent
27da31dc83
commit
7b36466c1c
1 file changed
+7
-1
@@ -789,7 +789,13 @@ def transcription(
|
|||||||
):
|
):
|
||||||
log.info(f"file.content_type: {file.content_type}")
|
log.info(f"file.content_type: {file.content_type}")
|
||||||
|
|
||||||
supported_filetypes = ("audio/mpeg", "audio/wav", "audio/ogg", "audio/x-m4a")
|
supported_filetypes = (
|
||||||
|
"audio/mpeg",
|
||||||
|
"audio/wav",
|
||||||
|
"audio/ogg",
|
||||||
|
"audio/x-m4a",
|
||||||
|
"audio/webm",
|
||||||
|
)
|
||||||
|
|
||||||
if not file.content_type.startswith(supported_filetypes):
|
if not file.content_type.startswith(supported_filetypes):
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
|||||||
Reference in new issue
Block a user