From a75cd8164fb0b8377d101fc8526783d4abd18f12 Mon Sep 17 00:00:00 2001 From: Laurent Mazare Date: Sat, 4 May 2024 10:41:18 +0200 Subject: [PATCH] Force the revision for the phi3-llama quantized models. (#2159) --- candle-examples/examples/quantized/main.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/candle-examples/examples/quantized/main.rs b/candle-examples/examples/quantized/main.rs index 4196ddcd..d91701ff 100644 --- a/candle-examples/examples/quantized/main.rs +++ b/candle-examples/examples/quantized/main.rs @@ -344,9 +344,18 @@ impl Args { "Phi-3-mini-4k-instruct-q4.gguf", ), }; + let revision = if self.which == Which::Phi3 { + "5eef2ce24766d31909c0b269fe90c817a8f263fb" + } else { + "main" + }; 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)