passed wide smoke check

This commit is contained in:
Per Stark committed 2025-12-10 13:54:08 +01:00
1 parent 2e2ea0c4ff
commit a5bc72aedf
12 files changed
+403 -235

No files matched your search

+2 -4
View File
@@ -20,8 +20,8 @@ use crate::{
#[allow(clippy::module_name_repetitions)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum EmbeddingBackend {
OpenAI,
#[default]
OpenAI,
FastEmbed,
Hashed,
}
@@ -276,9 +276,7 @@ fn bucket(token: &str, dimension: usize) -> usize {
let safe_dimension = dimension.max(1);
let mut hasher = DefaultHasher::new();
token.hash(&mut hasher);
usize::try_from(hasher.finish())
.unwrap_or_default()
% safe_dimension
usize::try_from(hasher.finish()).unwrap_or_default() % safe_dimension
}
// Backward compatibility function