Skip to content

Commit

Permalink
Excluded fixtures/scripts from lib
Browse files Browse the repository at this point in the history
  • Loading branch information
wdoppenberg committed Apr 26, 2024
1 parent 7aa68a5 commit db09098
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions 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 Down
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 db09098

Please sign in to comment.