Skip to content

Commit eb03373

Browse files
committed
fix format
1 parent 1de6921 commit eb03373

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lightllm/utils/multimodal_utils.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
logger = init_logger(__name__)
1717

18+
1819
class UrlResourcePool:
1920
def __init__(self, maxsize: int = 256):
2021
self._maxsize = maxsize
@@ -26,7 +27,9 @@ def __init__(self, maxsize: int = 256):
2627
def _normalize_url(url: str) -> str:
2728
return url.strip()
2829

29-
async def get_or_create(self, url: str, proxy: Optional[str], loader: Callable[[], Awaitable[bytes]]) -> bytes:
30+
async def get_or_create(
31+
self, url: str, proxy: Optional[str], loader: Callable[[], Awaitable[bytes]]
32+
) -> bytes:
3033
key = (self._normalize_url(url), proxy)
3134

3235
async with self._lock:
@@ -73,6 +76,7 @@ async def get_or_create(self, url: str, proxy: Optional[str], loader: Callable[[
7376

7477
return content
7578

79+
7680
URL_RESOURCE_POOL = UrlResourcePool(maxsize=get_lightllm_url_pool_maxsize())
7781

7882

@@ -122,7 +126,9 @@ async def _load() -> bytes:
122126
async for chunk in response.aiter_bytes(chunk_size=1024 * 1024):
123127
if request is not None and await request.is_disconnected():
124128
await response.aclose()
125-
raise ClientDisconnected(reason=f"client disconnected during url download")
129+
raise ClientDisconnected(
130+
reason=f"client disconnected during url download"
131+
)
126132
ans_bytes.append(chunk)
127133
# 接收的数据不能大于128M
128134
if len(ans_bytes) > 128:

0 commit comments

Comments
 (0)