Skip to content

Commit

Permalink
Excluded fixtures/scripts from lib (#33)
Browse files Browse the repository at this point in the history
* Excluded fixtures/scripts from lib

* Bump to 0.4.1
  • Loading branch information
wdoppenberg authored Apr 26, 2024
1 parent 7aa68a5 commit d9d513b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"crates/glowrs-server"
]
resolver = "2"
exclude = ["tests", "scripts"]

[workspace.dependencies]
candle-core = { version = "0.4.1" }
Expand All @@ -19,5 +20,5 @@ candle-transformers = { opt-level = 3 }

[workspace.package]
license = "Apache-2.0"
version = "0.4.0"
version = "0.4.1"

1 change: 1 addition & 0 deletions crates/glowrs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ documentation = "https://docs.rs/glowrs/"
readme = "README.md"
keywords = ["candle", "ai", "deep-learning", "embeddings", "openai"]
license = { workspace = true }
exclude = ["tests/fixtures/*"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
12 changes: 6 additions & 6 deletions crates/glowrs/src/model/embedder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ where

let token_ids = Tensor::stack(&token_ids, 0)?;

let pad_id: u32;
if let Some(pp) = tokenizer.get_padding() {
pad_id = pp.pad_id;
} else {
pad_id = 0;
}
let pad_id: u32 = {
match tokenizer.get_padding() {
Some(pp) => pp.pad_id,
None => 0,
}
};

let pad_mask = token_ids.ne(pad_id)?;

Expand Down

0 comments on commit d9d513b

Please sign in to comment.