diff --git a/modules/models/OpenAIVision.py b/modules/models/OpenAIVision.py index 79481a38..1f8ae00d 100644 --- a/modules/models/OpenAIVision.py +++ b/modules/models/OpenAIVision.py @@ -84,7 +84,7 @@ def image_to_base64(image_path): # 按压缩比例调整图片大小 new_width = int(width * scale_ratio) new_height = int(height * scale_ratio) - img = img.resize((new_width, new_height), Image.ANTIALIAS) + img = img.resize((new_width, new_height), Image.LANCZOS) # 将图片转换为jpg格式的二进制数据 buffer = BytesIO() diff --git a/modules/models/XMChat.py b/modules/models/XMChat.py index 3e8cd27f..8453a02d 100644 --- a/modules/models/XMChat.py +++ b/modules/models/XMChat.py @@ -48,7 +48,7 @@ def image_to_base64(self, image_path): # 按压缩比例调整图片大小 new_width = int(width * scale_ratio) new_height = int(height * scale_ratio) - img = img.resize((new_width, new_height), Image.ANTIALIAS) + img = img.resize((new_width, new_height), Image.LANCZOS) # 将图片转换为jpg格式的二进制数据 buffer = BytesIO()