Support `HF_HOME` and `HF_ENDPOINT`
Hello, I have noticed that `HF_HOME` and `HF_ENDPOINT` environment variables are not supported.
I presume this is because this [library](https://github.com/StarlightSearch/EmbedAnything/blob/27e6f7599635249123e5722821cfa3b9cf3e5cc6/rust/src/embeddings/local/bert.rs#L80) uses `ApiBuilder::new`, not [`ApiBuilder::from_env`](https://docs.rs/hf-hub/0.4.2/src/hf_hub/api/sync.rs.html#234-249) for `hf_hub::api::sync::ApiBuilder`.
Would it be possible to update all constructors from `ApiBuilder::new` into `ApiBuilder::from_env`?
1. I noticed this library uses `hf-hub` crate version [0.4.2](https://github.com/StarlightSearch/EmbedAnything/blob/27e6f7599635249123e5722821cfa3b9cf3e5cc6/rust/Cargo.toml#L38)
2. This version supports loading `HF_HOME` and `HF_ENDPOINT` through `ApiBuilder::from_env`.
3. A developer commented in this [issue](https://github.com/huggingface/hf-hub/issues/62#issuecomment-2565619320) that this is an opt-in.
关闭于 2025-10-21 5 条评论