Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion batched/batch_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ async def acall(self, item: Union[T, list[T]]) -> Union[U, list[U]]:
Returns:
U: The inferred result.
"""
import asyncio
import asyncio # noqa: PLC0415

if isinstance(item, list):
futures = self._schedule(item)
Expand Down
4 changes: 2 additions & 2 deletions batched/inference/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def torch_or_np(item: Any):


def stack_features(
inputs: list[dict[str, Feature]],
pad_tokens: dict[str, int],
inputs: list[dict[str, Feature]],
pad_tokens: dict[str, int],
padding_side: str = "right"
) -> dict[str, Feature]:
"""
Expand Down
2 changes: 1 addition & 1 deletion batched/inference/model_batch_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async def acall(self, *args, **kwargs) -> Feature:
Returns:
ModelOutputs: The processed model outputs.
"""
import asyncio
import asyncio # noqa: PLC0415

features = args[0] if args else kwargs
unstacked_features = unstack_features(features)
Expand Down
2 changes: 1 addition & 1 deletion batched/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def __init__(
**kwargs: Any,
) -> None:
with ensure_import("diskcache"):
import diskcache
import diskcache # noqa: PLC0415

path = Path(cache_dir).expanduser().resolve()
path.mkdir(parents=True, exist_ok=True)
Expand Down