Skip to content

Commit

Permalink
fix: put traversal_paths in kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiniuYu committed Aug 2, 2022
1 parent 56f2289 commit b753673
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions server/clip_server/executors/clip_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,18 @@ def __init__(
num_worker_preprocess: int = 4,
minibatch_size: int = 32,
access_paths: str = '@r',
traversal_paths: Optional[str] = '@r',
model_path: Optional[str] = None,
**kwargs,
):
super().__init__(**kwargs)

self._minibatch_size = minibatch_size
self._access_paths = access_paths
if traversal_paths is not None:
if 'traversal_paths' in kwargs:
warnings.warn(
f'`traversal_paths` is deprecated. Use `access_paths` instead.'
)
self._access_paths = traversal_paths
self._access_paths = kwargs['traversal_paths']

self._pool = ThreadPool(processes=num_worker_preprocess)

Expand Down
4 changes: 2 additions & 2 deletions server/clip_server/executors/clip_tensorrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def __init__(

self._minibatch_size = minibatch_size
self._access_paths = access_paths
if traversal_paths is not None:
if 'traversal_paths' in kwargs:
warnings.warn(
f'`traversal_paths` is deprecated. Use `access_paths` instead.'
)
self._access_paths = traversal_paths
self._access_paths = kwargs['traversal_paths']

self._device = device

Expand Down
4 changes: 2 additions & 2 deletions server/clip_server/executors/clip_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ def __init__(

self._minibatch_size = minibatch_size
self._access_paths = access_paths
if traversal_paths is not None:
if 'traversal_paths' in kwargs:
warnings.warn(
f'`traversal_paths` is deprecated. Use `access_paths` instead.'
)
self._access_paths = traversal_paths
self._access_paths = kwargs['traversal_paths']

if not device:
self._device = 'cuda' if torch.cuda.is_available() else 'cpu'
Expand Down

0 comments on commit b753673

Please sign in to comment.