Skip to content

Commit

Permalink
style: fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
gmastrapas committed Feb 17, 2022
1 parent 874bb63 commit c577faf
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ class ONNXEncoder(Executor):
"""

def __init__(
self,
model_path: str,
device: str = 'cpu',
batch_size: int = 32,
**kwargs,
self,
model_path: str,
device: str = 'cpu',
batch_size: int = 32,
**kwargs,
) -> None:
"""
Initialization
Expand All @@ -41,5 +41,10 @@ def __init__(
def encode(self, docs: DocumentArray, **_) -> Optional[DocumentArray]:
"""Encode docs."""
docs.tensors = docs.tensors.astype(np.float32)
docs.embed(self._session, device=self._device, batch_size=self._batch_size, to_numpy=True)
docs.embed(
self._session,
device=self._device,
batch_size=self._batch_size,
to_numpy=True,
)
return docs

0 comments on commit c577faf

Please sign in to comment.