Closed lz1998 closed 9 months ago
The bert model in candle doesn't use any attention mask as it's not setup for autoregressive inference but rather for computing embeddings, so there is no real attention mask to be applied down the line when doing mean-pooling etc (each sequence position can attend to all the other sequence positions).
The bert model in candle doesn't use any attention mask as it's not setup for autoregressive inference but rather for computing embeddings, so there is no real attention mask to be applied down the line when doing mean-pooling etc (each sequence position can attend to all the other sequence positions).
Is there something like SentenceTransformer?
I am trying to run
shibing624/text2vec-base-chinese
with candle, and the encoder returnsinput_ids
,attention_mask
,token_id_types
, but there are only two params of BertModel in candle.https://github.com/huggingface/candle/blob/main/candle-examples/examples/bert/main.rs#L170