Spaces:
Sleeping
Sleeping
Tuchuanhuhuhu
commited on
Commit
·
b5980ba
1
Parent(s):
b397350
bugfix: 修复Pillow 10 的API变动导致的出错 fix #938
Browse files
modules/models/OpenAIVision.py
CHANGED
@@ -84,7 +84,7 @@ class OpenAIVisionClient(BaseLLMModel):
|
|
84 |
# 按压缩比例调整图片大小
|
85 |
new_width = int(width * scale_ratio)
|
86 |
new_height = int(height * scale_ratio)
|
87 |
-
img = img.resize((new_width, new_height), Image.
|
88 |
|
89 |
# 将图片转换为jpg格式的二进制数据
|
90 |
buffer = BytesIO()
|
|
|
84 |
# 按压缩比例调整图片大小
|
85 |
new_width = int(width * scale_ratio)
|
86 |
new_height = int(height * scale_ratio)
|
87 |
+
img = img.resize((new_width, new_height), Image.LANCZOS)
|
88 |
|
89 |
# 将图片转换为jpg格式的二进制数据
|
90 |
buffer = BytesIO()
|
modules/models/XMChat.py
CHANGED
@@ -48,7 +48,7 @@ class XMChat(BaseLLMModel):
|
|
48 |
# 按压缩比例调整图片大小
|
49 |
new_width = int(width * scale_ratio)
|
50 |
new_height = int(height * scale_ratio)
|
51 |
-
img = img.resize((new_width, new_height), Image.
|
52 |
|
53 |
# 将图片转换为jpg格式的二进制数据
|
54 |
buffer = BytesIO()
|
|
|
48 |
# 按压缩比例调整图片大小
|
49 |
new_width = int(width * scale_ratio)
|
50 |
new_height = int(height * scale_ratio)
|
51 |
+
img = img.resize((new_width, new_height), Image.LANCZOS)
|
52 |
|
53 |
# 将图片转换为jpg格式的二进制数据
|
54 |
buffer = BytesIO()
|