1
0
mirror of https://github.com/osmarks/meme-search-engine.git synced 2024-11-14 15:54:48 +00:00

the consequences of my own actions

This commit is contained in:
osmarks 2024-05-21 12:39:04 +01:00
parent e705a9db21
commit 63a9b3d9a6

View File

@ -347,7 +347,7 @@ async fn ingest_files(config: Arc<Config>, backend: Arc<InferenceServerConfig>)
loop { loop {
let quality = (lb + ub) / 2; let quality = (lb + ub) / 2;
let thumbnail = rgb.resize( let thumbnail = rgb.resize(
format_config.target_width, format_config.target_width.min(rgb.width()),
u32::MAX, u32::MAX,
FilterType::Lanczos3, FilterType::Lanczos3,
); );
@ -370,7 +370,7 @@ async fn ingest_files(config: Arc<Config>, backend: Arc<InferenceServerConfig>)
} }
} else { } else {
let thumbnail = rgb.resize( let thumbnail = rgb.resize(
format_config.target_width, format_config.target_width.min(rgb.width()),
u32::MAX, u32::MAX,
FilterType::Lanczos3, FilterType::Lanczos3,
); );
@ -590,7 +590,6 @@ async fn build_index(config: Arc<Config>, backend: Arc<InferenceServerConfig>) -
let pool = initialize_database(&config).await?; let pool = initialize_database(&config).await?;
let mut index = IIndex { let mut index = IIndex {
// Use a suitable vector similarity search library for Rust
vectors: faiss::index_factory(backend.embedding_size as u32, "SQfp16", faiss::MetricType::InnerProduct)?, vectors: faiss::index_factory(backend.embedding_size as u32, "SQfp16", faiss::MetricType::InnerProduct)?,
filenames: Vec::new(), filenames: Vec::new(),
format_codes: Vec::new(), format_codes: Vec::new(),