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
55 changes: 24 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ members = [
"kernels-common",
]
resolver = "2"

[workspace.dependencies]
hf-hub = { version = "1.1.0", git = "https://github.com/huggingface/hf-hub", rev = "8b00e9eab4a27a614e414692d71791d8e33f7149", features = ["blocking"] }
2 changes: 1 addition & 1 deletion kernel-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ clap-markdown = "0.1.5"
clap_complete = "4"
eyre = "0.6.12"
git2 = "0.20"
hf-hub = { version = "1.1.0", git = "https://github.com/huggingface/hf-hub", rev = "8b00e9eab4a27a614e414692d71791d8e33f7149", features = ["blocking"] }
hf-hub = { workspace = true }
indicatif = "0.17"
itertools = "0.13"
minijinja = "2.5"
Expand Down
13 changes: 2 additions & 11 deletions kernel-builder/src/hf.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
use eyre::{Context, Result};
use hf_hub::{HFClientSync, HFRepositorySync, RepoType};
use kernels_common::hf::HFKernelsClientBuilder;

/// Build a sync HF API client.
pub fn api() -> Result<hf_hub::HFClientSync> {
let mut builder = hf_hub::HFClient::builder();

if let Ok(endpoint) = std::env::var("HF_ENDPOINT") {
builder = builder.endpoint(endpoint);
}

if let Ok(token) = std::env::var("HF_TOKEN") {
builder = builder.token(token);
}

builder
HFKernelsClientBuilder::new()
.build_sync()
.context("Cannot create Hugging Face API client")
}
Expand Down
1 change: 1 addition & 0 deletions kernels-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ repository = "https://github.com/huggingface/kernels"
base64 = "0.22"
digest = "0.11"
eyre = "0.6.12"
hf-hub = { workspace = true }
itertools = "0.13"
monostate = "0.1"
regex = "1"
Expand Down
Loading
Loading