Skip to content

Commit 8c74320

Browse files
committed
fix: suppress cast_possible_truncation clippy lint in embedding pooling
1 parent ca7506b commit 8c74320

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

mistralrs-core/src/embedding_models/layers.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ impl Module for Pooling {
4747
if self.pooling_mode_mean_tokens {
4848
// Assume full attention mask. Otherwise this must be updated
4949
// Mean pooling: sum(embeddings) / seq_len
50-
let seq_len = xs.dim(1)? as u32 as f64;
50+
#[allow(clippy::cast_possible_truncation)]
51+
let seq_len = xs.dim(1)? as f64;
5152
let mean_embeddings = (xs.sum(1)? / seq_len)?;
5253
outputs.push(mean_embeddings);
5354
}

0 commit comments

Comments
 (0)