sensein / b2aiprep

Apache License 2.0
5 stars 6 forks source link

Inference on GPU for speaker verification #8

Closed GasserElbanna closed 5 months ago

GasserElbanna commented 5 months ago

The ecapa verification works well but quite slow (~7 mins for 100 pairs).

Consider running inference on gpu if the machine has one.

add this argument run_opts={"device":"cuda"} to the code below. Also make sure that the audio tensors are copied to the device as well e.g. audio_tensor.to("cuda").

https://github.com/sensein/b2aiprep/blob/85dcd1146b305dc0f965d0abf3a7ab810088ca58/src/b2aiprep/process.py#L64

Source: https://huggingface.co/speechbrain/spkrec-ecapa-voxceleb#inference-on-gpu