Skip to content

Commit

Permalink
chore(deps): Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
emmyoh committed Dec 11, 2024
1 parent 7f9e8ca commit b5a3e35
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 38 deletions.
37 changes: 15 additions & 22 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand All @@ -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"]
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
12 changes: 3 additions & 9 deletions src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
}
}
Expand Down Expand Up @@ -140,12 +140,6 @@ where
model: &Mod,
documents: &[S],
) -> Result<(usize, usize), Box<dyn Error>> {
// documents.dedup();
// let model = TextEmbedding::try_new(InitOptions {
// model_name: EmbeddingModel::BGESmallENV15,
// show_download_progress: false,
// ..Default::default()
// })?;
let new_embeddings: Vec<Embedding> = model.embed_documents(documents.to_vec())?;
let length_and_dimension = (new_embeddings.len(), new_embeddings[0].len());
let mut searcher: Searcher<DistanceUnit> = Searcher::default();
Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ fn main() -> Result<(), Box<dyn Error>> {
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,
Expand Down Expand Up @@ -214,7 +215,7 @@ fn main() -> Result<(), Box<dyn Error>> {
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 => {
Expand Down
8 changes: 3 additions & 5 deletions src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@ pub trait DatabaseEmbeddingModel {

impl DatabaseEmbeddingModel for TextEmbedding {
fn new() -> Result<Self, Box<dyn Error>> {
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<S: AsRef<str> + Send + Sync>(
&self,
Expand Down

0 comments on commit b5a3e35

Please sign in to comment.