From 022450768f8451974b57d2e4d0cde2f33eee69ea Mon Sep 17 00:00:00 2001 From: Jyong <76649700+JohnJyong@users.noreply.github.com> Date: Wed, 20 Dec 2023 13:03:08 +0800 Subject: [PATCH] fix gpt 4v upload image issue (#1799) Co-authored-by: jyong --- api/services/file_service.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/services/file_service.py b/api/services/file_service.py index af665cb652..27f9527134 100644 --- a/api/services/file_service.py +++ b/api/services/file_service.py @@ -30,9 +30,11 @@ class FileService: etl_type = current_app.config['ETL_TYPE'] if etl_type == 'Unstructured': allowed_extensions = ['txt', 'markdown', 'md', 'pdf', 'html', 'htm', 'xlsx', - 'docx', 'csv', 'eml', 'msg', 'pptx', 'ppt', 'xml'] + 'docx', 'csv', 'eml', 'msg', 'pptx', 'ppt', 'xml', + 'jpg', 'jpeg', 'png', 'webp', 'gif', 'svg'] else: - allowed_extensions = ['txt', 'markdown', 'md', 'pdf', 'html', 'htm', 'xlsx', 'docx', 'csv'] + allowed_extensions = ['txt', 'markdown', 'md', 'pdf', 'html', 'htm', 'xlsx', 'docx', 'csv', + 'jpg', 'jpeg', 'png', 'webp', 'gif', 'svg'] if extension.lower() not in allowed_extensions: raise UnsupportedFileTypeError() elif only_image and extension.lower() not in IMAGE_EXTENSIONS: