candle icon indicating copy to clipboard operation
candle copied to clipboard

bert attention mask

Open lz1998 opened this issue 1 year ago • 2 comments
trafficstars

lz1998 avatar Mar 25 '24 14:03 lz1998

Is there something like torch.finfo(dtype).min in candle?

lz1998 avatar Mar 25 '24 14:03 lz1998

Probably a duplicate of #1799

unlimitedsola avatar Mar 26 '24 00:03 unlimitedsola

Is there something like torch.finfo(dtype).min in candle?

@lz1998, you can use f32::NEG_INFINITY and then cast to the correct Tensor type.

EricLBuehler avatar May 30 '24 18:05 EricLBuehler

What's the status of this PR? I've noticed that this PR is necessary to match the output of transformers or sentence_transformers when batch inputs are of different token length.

kczimm avatar Jun 11 '24 19:06 kczimm

+1 for this. Please merge it. @LaurentMazare

harryfei avatar Jul 31 '24 10:07 harryfei

Merged, thanks and sorry for the delay.

LaurentMazare avatar Aug 01 '24 06:08 LaurentMazare