We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c51efb commit a44996fCopy full SHA for a44996f
lightllm/utils/image_utils.py
@@ -15,15 +15,15 @@ def image2base64(img_str: str):
15
16
async def fetch_image(url, timeout):
17
async with httpx.AsyncClient() as client:
18
- async with client.stream('GET', url, timeout=timeout) as response:
+ async with client.stream("GET", url, timeout=timeout) as response:
19
response.raise_for_status()
20
ans_bytes = []
21
22
- async for chunk in response.aiter_bytes(chunk_size=1024*1024):
+ async for chunk in response.aiter_bytes(chunk_size=1024 * 1024):
23
ans_bytes.append(chunk)
24
# 接收的数据不能大于128M
25
if len(ans_bytes) > 128:
26
raise Exception("image data is too big")
27
-
+
28
content = b"".join(ans_bytes)
29
- return content
+ return content
0 commit comments