summaryrefslogtreecommitdiff
path: root/candle-examples/examples/bert/main.rs
diff options
context:
space:
mode:
authorNicolas Patry <patry.nicolas@protonmail.com>2023-08-29 14:32:15 +0200
committerGitHub <noreply@github.com>2023-08-29 14:32:15 +0200
commit3d2d3c7edba0b9c68b22d6cdb3091de3f8c63def (patch)
tree13ee76dd22f69ce51d4ee0be20352926b55d390c /candle-examples/examples/bert/main.rs
parent1d6bff53fcf500f452d0de412ff643e315db6779 (diff)
parent1aca6fa2913bbe7f34a1a28ae8f6074b73aed2c0 (diff)
downloadcandle-3d2d3c7edba0b9c68b22d6cdb3091de3f8c63def.tar.gz
candle-3d2d3c7edba0b9c68b22d6cdb3091de3f8c63def.tar.bz2
candle-3d2d3c7edba0b9c68b22d6cdb3091de3f8c63def.zip
Merge pull request #658 from huggingface/upgrade_hf_hub2
Upgrading hf-hub (for windows support, removing symlink requirement).
Diffstat (limited to 'candle-examples/examples/bert/main.rs')
-rw-r--r--candle-examples/examples/bert/main.rs8
1 files 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 {