summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/bing
diff options
context:
space:
mode:
authorAkash Mondal <a98mondal@gmail.com>2024-01-13 14:01:28 +0100
committerAkash Mondal <a98mondal@gmail.com>2024-01-13 14:01:28 +0100
commitc2115309aba793530f7072848154fcad97d866b1 (patch)
treecad46b9313e09198cf3b5d7d51b2c235c96201e1 /g4f/Provider/bing
parent~ (diff)
downloadgpt4free-c2115309aba793530f7072848154fcad97d866b1.tar
gpt4free-c2115309aba793530f7072848154fcad97d866b1.tar.gz
gpt4free-c2115309aba793530f7072848154fcad97d866b1.tar.bz2
gpt4free-c2115309aba793530f7072848154fcad97d866b1.tar.lz
gpt4free-c2115309aba793530f7072848154fcad97d866b1.tar.xz
gpt4free-c2115309aba793530f7072848154fcad97d866b1.tar.zst
gpt4free-c2115309aba793530f7072848154fcad97d866b1.zip
Diffstat (limited to 'g4f/Provider/bing')
-rw-r--r--g4f/Provider/bing/upload_image.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/g4f/Provider/bing/upload_image.py b/g4f/Provider/bing/upload_image.py
index 329e6df4..0909e5fb 100644
--- a/g4f/Provider/bing/upload_image.py
+++ b/g4f/Provider/bing/upload_image.py
@@ -6,7 +6,7 @@ import json
import re
import io
import base64
-import numpy as np
+import math
from PIL import Image
from aiohttp import ClientSession
@@ -29,8 +29,8 @@ async def upload_image(
width, height = img.size
max_image_pixels = image_config['maxImagePixels']
if max_image_pixels / (width * height) < 1:
- new_width = int(width * np.sqrt(max_image_pixels / (width * height)))
- new_height = int(height * np.sqrt(max_image_pixels / (width * height)))
+ new_width = int(width * math.sqrt(max_image_pixels / (width * height)))
+ new_height = int(height * math.sqrt(max_image_pixels / (width * height)))
else:
new_width = width
new_height = height