Fixing quantized llama demo on metal. (#1703)

This commit is contained in:
Nicolas Patry
2024-02-13 16:28:56 +01:00
committed by GitHub
parent ad73e93da2
commit c1b418586c
4 changed files with 34 additions and 13 deletions

View File

@ -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,
})
}