diff options
author | Nicolas Patry <patry.nicolas@protonmail.com> | 2023-07-27 20:05:02 +0200 |
---|---|---|
committer | Nicolas Patry <patry.nicolas@protonmail.com> | 2023-07-27 20:05:02 +0200 |
commit | ca479a873eeebb21cdef1e2a95d11fea742390f4 (patch) | |
tree | 9eacde1a20b627cd468c22d10bce70593412a961 /candle-examples/examples/falcon | |
parent | f291065f6cac82827a47a736ebf78e4fc9c7c569 (diff) | |
download | candle-ca479a873eeebb21cdef1e2a95d11fea742390f4.tar.gz candle-ca479a873eeebb21cdef1e2a95d11fea742390f4.tar.bz2 candle-ca479a873eeebb21cdef1e2a95d11fea742390f4.zip |
Upgrading hf-hub to `0.2.0` (Modified API to not pass the Repo around
all the time)
Diffstat (limited to 'candle-examples/examples/falcon')
-rw-r--r-- | candle-examples/examples/falcon/main.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/candle-examples/examples/falcon/main.rs b/candle-examples/examples/falcon/main.rs index 3a284c86..a01191a5 100644 --- a/candle-examples/examples/falcon/main.rs +++ b/candle-examples/examples/falcon/main.rs @@ -123,14 +123,18 @@ fn main() -> Result<()> { let device = candle_examples::device(args.cpu)?; let start = std::time::Instant::now(); let api = Api::new()?; - let repo = Repo::with_revision(args.model_id, RepoType::Model, args.revision); - let tokenizer_filename = api.get(&repo, "tokenizer.json")?; + let repo = api.repo(Repo::with_revision( + args.model_id, + RepoType::Model, + args.revision, + )); + let tokenizer_filename = repo.get("tokenizer.json")?; let mut filenames = vec![]; for rfilename in [ "model-00001-of-00002.safetensors", "model-00002-of-00002.safetensors", ] { - let filename = api.get(&repo, rfilename)?; + let filename = repo.get(rfilename)?; filenames.push(filename); } println!("retrieved the files in {:?}", start.elapsed()); |