Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rust/src/embeddings/local/bert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl BertEmbedder {
};

let (config_filename, tokenizer_filename, weights_filename) = {
let api = ApiBuilder::new()
let api = ApiBuilder::from_env()
.with_token(token.map(|s| s.to_string()))
.build()
.unwrap();
Expand Down Expand Up @@ -299,7 +299,7 @@ pub struct SparseBertEmbedder {
impl SparseBertEmbedder {
pub fn new(model_id: String, revision: Option<String>, token: Option<&str>) -> Result<Self, E> {
let (config_filename, tokenizer_filename, weights_filename) = {
let api = ApiBuilder::new()
let api = ApiBuilder::from_env()
.with_token(token.map(|s| s.to_string()))
.build()
.unwrap();
Expand Down
4 changes: 2 additions & 2 deletions rust/src/embeddings/local/clip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl Default for ClipEmbedder {

impl ClipEmbedder {
pub fn new(model_id: String, revision: Option<&str>, token: Option<&str>) -> Result<Self, E> {
let api = hf_hub::api::sync::ApiBuilder::new()
let api = hf_hub::api::sync::ApiBuilder::from_env()
.with_token(token.map(|s| s.to_string()))
.build()?;

Expand Down Expand Up @@ -372,7 +372,7 @@ mod tests {
"EmbedAnything is the best!".to_string(),
]
);
assert_eq!(input_ids.shape().clone().into_dims(), &[2, 8]);
assert_eq!(input_ids.shape().clone().into_dims(), &[2, 77]);
}

// Tests the load_image method.
Expand Down
2 changes: 1 addition & 1 deletion rust/src/embeddings/local/jina.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl Default for JinaEmbedder {

impl JinaEmbedder {
pub fn new(model_id: &str, revision: Option<&str>, token: Option<&str>) -> Result<Self, E> {
let api = hf_hub::api::sync::ApiBuilder::new()
let api = hf_hub::api::sync::ApiBuilder::from_env()
.with_token(token.map(|s| s.to_string()))
.build()?;
let api = match revision {
Expand Down
2 changes: 1 addition & 1 deletion rust/src/embeddings/local/modernbert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl ModernBertEmbedder {
dtype: Option<Dtype>,
) -> Result<Self, E> {
let (config_filename, tokenizer_filename, weights_filename) = {
let api = ApiBuilder::new()
let api = ApiBuilder::from_env()
.with_token(token.map(|s| s.to_string()))
.build()
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion rust/src/embeddings/local/qwen3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl Qwen3Embedder {
token: Option<&str>,
dtype: Option<crate::Dtype>,
) -> Result<Self, anyhow::Error> {
let api = ApiBuilder::new()
let api = ApiBuilder::from_env()
.with_token(token.map(|s| s.to_string()))
.build()
.unwrap();
Expand Down
Loading