summaryrefslogtreecommitdiff
path: root/candle-examples/examples/quantized-phi/main.rs
diff options
context:
space:
mode:
authorLaurent Mazare <laurent.mazare@gmail.com>2024-05-03 15:03:22 +0200
committerGitHub <noreply@github.com>2024-05-03 15:03:22 +0200
commit59b18d974ec3cad6963b774aa245e23f8c80414f (patch)
tree09e946a0a14eed6a47d274c2b1f0aa6436a1f4ff /candle-examples/examples/quantized-phi/main.rs
parent89f53b9d7b36bbc0f555cd3c9882d21f84b2e13f (diff)
downloadcandle-59b18d974ec3cad6963b774aa245e23f8c80414f.tar.gz
candle-59b18d974ec3cad6963b774aa245e23f8c80414f.tar.bz2
candle-59b18d974ec3cad6963b774aa245e23f8c80414f.zip
Pin the version used for the quantized phi 3 gguf file. (#2156)
Diffstat (limited to 'candle-examples/examples/quantized-phi/main.rs')
-rw-r--r--candle-examples/examples/quantized-phi/main.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/candle-examples/examples/quantized-phi/main.rs b/candle-examples/examples/quantized-phi/main.rs
index c18d25cf..7d255f58 100644
--- a/candle-examples/examples/quantized-phi/main.rs
+++ b/candle-examples/examples/quantized-phi/main.rs
@@ -109,16 +109,21 @@ impl Args {
let model_path = match &self.model {
Some(config) => std::path::PathBuf::from(config),
None => {
- let (repo, filename) = match self.which {
- Which::Phi2 => ("TheBloke/phi-2-GGUF", "phi-2.Q4_K_M.gguf"),
+ let (repo, filename, revision) = match self.which {
+ Which::Phi2 => ("TheBloke/phi-2-GGUF", "phi-2.Q4_K_M.gguf", "main"),
Which::Phi3 => (
"microsoft/Phi-3-mini-4k-instruct-gguf",
"Phi-3-mini-4k-instruct-q4.gguf",
+ "5eef2ce24766d31909c0b269fe90c817a8f263fb",
),
};
let api = hf_hub::api::sync::Api::new()?;
- let api = api.model(repo.to_string());
- api.get(filename)?
+ api.repo(hf_hub::Repo::with_revision(
+ repo.to_string(),
+ hf_hub::RepoType::Model,
+ revision.to_string(),
+ ))
+ .get(filename)?
}
};
Ok(model_path)