Skip to content

Commit

Permalink
fixz: set torch num threads to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijianma committed Nov 14, 2023
1 parent 8288a4a commit 74a094e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data_juicer/ops/filter/clip_similarity_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from ..op_fusion import LOADED_IMAGES

# avoid hanging when calling clip in multiprocessing
torch.get_num_threads()
torch.set_num_threads(1)


@OPERATORS.register_module('clip_similarity_filter')
Expand Down
2 changes: 1 addition & 1 deletion tests/ops/filter/test_clip_similarity_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def test_multi_process(self):
any_or_all='any',
min_ratio=0.2,
max_ratio=0.9)
self._run_filter(dataset, tgt_list, op, num_proc=1)
self._run_filter(dataset, tgt_list, op, num_proc=4)


if __name__ == '__main__':
Expand Down

0 comments on commit 74a094e

Please sign in to comment.