Skip to content

Commit a44996f

Browse files
committed
fix
1 parent 1c51efb commit a44996f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lightllm/utils/image_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ def image2base64(img_str: str):
1515

1616
async def fetch_image(url, timeout):
1717
async with httpx.AsyncClient() as client:
18-
async with client.stream('GET', url, timeout=timeout) as response:
18+
async with client.stream("GET", url, timeout=timeout) as response:
1919
response.raise_for_status()
2020
ans_bytes = []
2121

22-
async for chunk in response.aiter_bytes(chunk_size=1024*1024):
22+
async for chunk in response.aiter_bytes(chunk_size=1024 * 1024):
2323
ans_bytes.append(chunk)
2424
# 接收的数据不能大于128M
2525
if len(ans_bytes) > 128:
2626
raise Exception("image data is too big")
27-
27+
2828
content = b"".join(ans_bytes)
29-
return content
29+
return content

0 commit comments

Comments
 (0)