mirror of
https://github.com/open-webui/open-webui
synced 2025-05-24 06:44:24 +00:00
enh: audio/x-m4a support
This commit is contained in:
parent
33d8d818bd
commit
e268ee5675
@ -360,7 +360,7 @@ def transcribe(
|
|||||||
):
|
):
|
||||||
log.info(f"file.content_type: {file.content_type}")
|
log.info(f"file.content_type: {file.content_type}")
|
||||||
|
|
||||||
if file.content_type not in ["audio/mpeg", "audio/wav", "audio/ogg"]:
|
if file.content_type not in ["audio/mpeg", "audio/wav", "audio/ogg", "audio/x-m4a"]:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_400_BAD_REQUEST,
|
status_code=status.HTTP_400_BAD_REQUEST,
|
||||||
detail=ERROR_MESSAGES.FILE_NOT_SUPPORTED,
|
detail=ERROR_MESSAGES.FILE_NOT_SUPPORTED,
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
files = [...files, fileItem];
|
files = [...files, fileItem];
|
||||||
|
|
||||||
// Check if the file is an audio file and transcribe/convert it to text file
|
// Check if the file is an audio file and transcribe/convert it to text file
|
||||||
if (['audio/mpeg', 'audio/wav', 'audio/ogg'].includes(file['type'])) {
|
if (['audio/mpeg', 'audio/wav', 'audio/ogg', 'audio/x-m4a'].includes(file['type'])) {
|
||||||
const res = await transcribeAudio(localStorage.token, file).catch((error) => {
|
const res = await transcribeAudio(localStorage.token, file).catch((error) => {
|
||||||
toast.error(error);
|
toast.error(error);
|
||||||
return null;
|
return null;
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
const uploadDoc = async (file, tags?: object) => {
|
const uploadDoc = async (file, tags?: object) => {
|
||||||
console.log(file);
|
console.log(file);
|
||||||
// Check if the file is an audio file and transcribe/convert it to text file
|
// Check if the file is an audio file and transcribe/convert it to text file
|
||||||
if (['audio/mpeg', 'audio/wav', 'audio/ogg'].includes(file['type'])) {
|
if (['audio/mpeg', 'audio/wav', 'audio/ogg', 'audio/x-m4a'].includes(file['type'])) {
|
||||||
const transcribeRes = await transcribeAudio(localStorage.token, file).catch((error) => {
|
const transcribeRes = await transcribeAudio(localStorage.token, file).catch((error) => {
|
||||||
toast.error(error);
|
toast.error(error);
|
||||||
return null;
|
return null;
|
||||||
|
@ -31,7 +31,9 @@ export const SUPPORTED_FILE_TYPE = [
|
|||||||
'application/x-javascript',
|
'application/x-javascript',
|
||||||
'text/markdown',
|
'text/markdown',
|
||||||
'audio/mpeg',
|
'audio/mpeg',
|
||||||
'audio/wav'
|
'audio/wav',
|
||||||
|
'audio/ogg',
|
||||||
|
'audio/x-m4a'
|
||||||
];
|
];
|
||||||
|
|
||||||
export const SUPPORTED_FILE_EXTENSIONS = [
|
export const SUPPORTED_FILE_EXTENSIONS = [
|
||||||
|
Loading…
Reference in New Issue
Block a user