From 4ed202447e1d1a3667d23306e47a08a5b3429c97 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Tue, 29 Aug 2023 14:14:26 +0200 Subject: [PATCH 1/2] Upgrading hf-hub. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index f60bde8c..dc48ccd8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ clap = { version = "4.2.4", features = ["derive"] } cudarc = { version = "0.9.14", features = ["f16"] } # TODO: Switch back to the official gemm implementation once it has caught up. gemm = { version = "0.15.6", package = "candle-gemm" } -hf-hub = "0.2.0" +hf-hub = "0.3.0" half = { version = "2.3.1", features = ["num-traits", "use-intrinsics", "rand_distr"] } image = { version = "0.24.7", default-features = false, features = ["jpeg", "png"] } imageproc = { version = "0.23.0", default-features = false } From 1aca6fa2913bbe7f34a1a28ae8f6074b73aed2c0 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Tue, 29 Aug 2023 14:18:54 +0200 Subject: [PATCH 2/2] Upgrading hf-hub. --- candle-examples/examples/bert/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/candle-examples/examples/bert/main.rs b/candle-examples/examples/bert/main.rs index b0c0e18a..6cee66ee 100644 --- a/candle-examples/examples/bert/main.rs +++ b/candle-examples/examples/bert/main.rs @@ -62,16 +62,16 @@ impl Args { let repo = Repo::with_revision(model_id, RepoType::Model, revision); let (config_filename, tokenizer_filename, weights_filename) = if self.offline { - let cache = Cache::default(); + let cache = Cache::default().repo(repo); ( cache - .get(&repo, "config.json") + .get("config.json") .ok_or(anyhow!("Missing config file in cache"))?, cache - .get(&repo, "tokenizer.json") + .get("tokenizer.json") .ok_or(anyhow!("Missing tokenizer file in cache"))?, cache - .get(&repo, "model.safetensors") + .get("model.safetensors") .ok_or(anyhow!("Missing weights file in cache"))?, ) } else {