diff --git a/Cargo.toml b/Cargo.toml index e4eca8b..fecdee1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,28 +23,28 @@ required-features = ["cli"] [dependencies] bincode = "1.3.3" -clap = { version = "4.5.4", features = ["derive"], optional = true } -fastembed = "3.5.0" +clap = { version = "4.5.23", features = ["derive"], optional = true } +fastembed = "4.3.0" hnsw = { version = "0.11.0", features = ["serde1"] } -ordered-float = "4.2.0" +ordered-float = "4.5.0" pcg_rand = { version = "0.13.0", features = ["serde1"] } -serde = "1.0.198" -simsimd = "4.3.1" +serde = "1.0.216" +simsimd = "6.2.1" space = "0.17.0" lz4_flex = { version = "0.11.3", default-features = false, features = ["frame"] } ticky = { version = "1.0.2", optional = true } pretty-duration = { version = "0.1.1", optional = true } -indicatif = { version = "0.17.8", optional = true, features = ["rayon", "improved_unicode"] } -distances = "1.6.3" -candle-examples = "0.4.1" -candle-core = "0.4.1" -candle-nn = "0.4.1" -candle-transformers = "0.4.1" +indicatif = { version = "0.17.9", optional = true, features = ["rayon", "improved_unicode"] } +distances = "1.8.0" +candle-examples = "0.8.1" +candle-core = "0.8.1" +candle-nn = "0.8.1" +candle-transformers = "0.8.1" hf-hub = "0.3.2" -viuer = { version = "0.7.1", optional = true } +viuer = { version = "0.9.1", features = ["print-file"], optional = true } sonogram = "0.7.1" -image = "0.24.9" -rodio = { version = "0.17.3", optional = true } +image = "0.25.5" +rodio = { version = "0.20.1", optional = true } [features] default = [] @@ -53,11 +53,4 @@ cuda = ["candle-core/cuda", "candle-examples/cuda", "candle-nn/cuda", "candle-tr mkl = ["candle-core/mkl", "candle-examples/mkl", "candle-nn/mkl", "candle-transformers/mkl"] metal = ["candle-core/metal", "candle-examples/metal", "candle-nn/metal", "candle-transformers/metal"] sixel = ["viuer/sixel"] -avif = ["image/avif-encoder", "image/avif-decoder"] -cli = ["clap", "ticky", "pretty-duration", "indicatif", "viuer", "rodio"] -clap = ["dep:clap"] -indicatif = ["dep:indicatif"] -pretty-duration = ["dep:pretty-duration"] -rodio = ["dep:rodio"] -ticky = ["dep:ticky"] -viuer = ["dep:viuer"] +cli = ["dep:clap", "dep:ticky", "dep:pretty-duration", "dep:indicatif", "dep:viuer", "dep:rodio"] diff --git a/README.md b/README.md index beaf3a5..e45628b 100644 --- a/README.md +++ b/README.md @@ -31,5 +31,4 @@ cargo install --git https://github.com/emmyoh/zebra --features="cli,accelerate,m * `mkl` - Uses Intel oneMKL with Intel CPUs and GPUs. * `metal` - Enables GPU support for Apple silicon machines. * `sixel` - Prints images in Sixel format when using the CLI with compatible terminals. -* `avif` - Enables querying & inserting AVIF images. * `cli` - Provides a command-line interface to Zebra. \ No newline at end of file diff --git a/src/db.rs b/src/db.rs index 414370c..6d1ac64 100644 --- a/src/db.rs +++ b/src/db.rs @@ -45,9 +45,9 @@ impl DocumentType { /// The name of the database file. pub fn database_name(&self) -> &str { match self { - DocumentType::Text => "text.db", - DocumentType::Image => "image.db", - &DocumentType::Audio => "audio.db", + DocumentType::Text => "text.zebra", + DocumentType::Image => "image.zebra", + &DocumentType::Audio => "audio.zebra", } } } @@ -140,12 +140,6 @@ where model: &Mod, documents: &[S], ) -> Result<(usize, usize), Box> { - // documents.dedup(); - // let model = TextEmbedding::try_new(InitOptions { - // model_name: EmbeddingModel::BGESmallENV15, - // show_download_progress: false, - // ..Default::default() - // })?; let new_embeddings: Vec = model.embed_documents(documents.to_vec())?; let length_and_dimension = (new_embeddings.len(), new_embeddings[0].len()); let mut searcher: Searcher = Searcher::default(); diff --git a/src/main.rs b/src/main.rs index a559a88..e02f16e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -186,6 +186,7 @@ fn main() -> Result<(), Box> { let mut buffer = BufWriter::new(stdout().lock()); let image_print_config = viuer::Config { transparent: true, + premultiplied_alpha: false, absolute_offset: false, x: 0, y: 0, @@ -214,7 +215,7 @@ fn main() -> Result<(), Box> { writeln!(buffer, "Results:")?; for result in query_results { let path = PathBuf::from(String::from_utf8(result)?); - let _print_result = viuer::print_from_file(&path, &image_print_config); + let _ = viuer::print_from_file(&path, &image_print_config); } } ImageCommands::Clear => { diff --git a/src/model.rs b/src/model.rs index 363a7ef..0b53b8d 100644 --- a/src/model.rs +++ b/src/model.rs @@ -44,11 +44,9 @@ pub trait DatabaseEmbeddingModel { impl DatabaseEmbeddingModel for TextEmbedding { fn new() -> Result> { - Ok(TextEmbedding::try_new(InitOptions { - model_name: EmbeddingModel::BGESmallENV15, - show_download_progress: false, - ..Default::default() - })?) + Ok(TextEmbedding::try_new( + InitOptions::new(EmbeddingModel::BGESmallENV15).with_show_download_progress(false), + )?) } fn embed_documents + Send + Sync>( &self,