We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca7506b commit 8c74320Copy full SHA for 8c74320
1 file changed
mistralrs-core/src/embedding_models/layers.rs
@@ -47,7 +47,8 @@ impl Module for Pooling {
47
if self.pooling_mode_mean_tokens {
48
// Assume full attention mask. Otherwise this must be updated
49
// Mean pooling: sum(embeddings) / seq_len
50
- let seq_len = xs.dim(1)? as u32 as f64;
+ #[allow(clippy::cast_possible_truncation)]
51
+ let seq_len = xs.dim(1)? as f64;
52
let mean_embeddings = (xs.sum(1)? / seq_len)?;
53
outputs.push(mean_embeddings);
54
}
0 commit comments