summaryrefslogtreecommitdiff
path: root/candle-examples/examples/mistral/main.rs
diff options
context:
space:
mode:
authorLaurent Mazare <laurent.mazare@gmail.com>2023-12-25 21:49:21 +0100
committerGitHub <noreply@github.com>2023-12-25 21:49:21 +0100
commit37c539f2b7dfc8aa67a10b611dc12e5e0428be00 (patch)
tree48980a31058157808fc777f7fbe50239931afc54 /candle-examples/examples/mistral/main.rs
parenteae3a20d43a855acbaa7afd4494acdef9648d2b3 (diff)
downloadcandle-37c539f2b7dfc8aa67a10b611dc12e5e0428be00.tar.gz
candle-37c539f2b7dfc8aa67a10b611dc12e5e0428be00.tar.bz2
candle-37c539f2b7dfc8aa67a10b611dc12e5e0428be00.zip
Helper function to load sharded safetensors files (#1481)
* Fix the quantized mistral example. * Add a helper function to load sharded safetensors weights. * Use the sharded loader.
Diffstat (limited to 'candle-examples/examples/mistral/main.rs')
-rw-r--r--candle-examples/examples/mistral/main.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/candle-examples/examples/mistral/main.rs b/candle-examples/examples/mistral/main.rs
index 2b31142e..5ed5e5cb 100644
--- a/candle-examples/examples/mistral/main.rs
+++ b/candle-examples/examples/mistral/main.rs
@@ -235,10 +235,7 @@ fn main() -> Result<()> {
if args.quantized {
vec![repo.get("model-q4k.gguf")?]
} else {
- vec![
- repo.get("model-00001-of-00002.safetensors")?,
- repo.get("model-00002-of-00002.safetensors")?,
- ]
+ candle_examples::hub_load_safetensors(&repo, "model.safetensors.index.json")?
}
}
};