Open hkristof03 opened 9 months ago
What version of sentence-transformers
are you using?
Yes sorry, I am using 2.3.1.
I cannot reproduce the issue you are having. What backend (torch or tensorflow) and what version are you using? What is the version of HF transformers you are using?
CUDA Version: 12.2 python=3.9.18
torch==2.2.0+cu121 transformers==4.37.2
Hmmm, I cannot reproduce your issue, even with the same setup. You might have to dig a bit deeper and debug what is going on inside CrossEncoder's predict method.
Moreover, the usage of multiple workers reduced the speed of the inference.
This will depend on you CPU (maximal number of suggested workers is os.cpu_count()). If you really believe that having multiple workers for DataLoader will help, you should benchmark and time different values.
Hi,
The usage of the
CrossEncoder.predict()
method withnum_workers
> 0 returns constant values. The below example returns full zeros. I haven't tested it on Linux, but this never occurred to me in PyTorch or Tensorflow dataloaders with multiprocessing based data loading. Moreover, the usage of multiple workers reduced the speed of the inference.Output:
`[0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.