summaryrefslogtreecommitdiff
path: root/candle-core/src/quantized/ggml_file.rs
diff options
context:
space:
mode:
authorNicolas Patry <patry.nicolas@protonmail.com>2024-02-13 16:28:56 +0100
committerGitHub <noreply@github.com>2024-02-13 16:28:56 +0100
commitc1b418586c9477a85150ce6c15dcfe4c93d3a27d (patch)
treedaabda27c6689f7ea9db68ceb8f6bd74ebf8f4b1 /candle-core/src/quantized/ggml_file.rs
parentad73e93da2cf7311cb5c5bc39250aa335c5f9b76 (diff)
downloadcandle-c1b418586c9477a85150ce6c15dcfe4c93d3a27d.tar.gz
candle-c1b418586c9477a85150ce6c15dcfe4c93d3a27d.tar.bz2
candle-c1b418586c9477a85150ce6c15dcfe4c93d3a27d.zip
Fixing quantized llama demo on metal. (#1703)
Diffstat (limited to 'candle-core/src/quantized/ggml_file.rs')
-rw-r--r--candle-core/src/quantized/ggml_file.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/candle-core/src/quantized/ggml_file.rs b/candle-core/src/quantized/ggml_file.rs
index 38238580..e6f5791c 100644
--- a/candle-core/src/quantized/ggml_file.rs
+++ b/candle-core/src/quantized/ggml_file.rs
@@ -233,6 +233,7 @@ pub struct Content {
pub hparams: HParams,
pub vocab: Vocab,
pub tensors: HashMap<String, super::QTensor>,
+ pub device: Device,
}
impl Content {
@@ -252,11 +253,13 @@ impl Content {
let (name, tensor) = read_one_tensor(reader, magic, device)?;
tensors.insert(name, tensor);
}
+ let device = device.clone();
Ok(Self {
magic,
hparams,
vocab,
tensors,
+ device,
})
}