diff options
author | Nicolas Patry <patry.nicolas@protonmail.com> | 2023-12-29 12:06:38 +0100 |
---|---|---|
committer | Nicolas Patry <patry.nicolas@protonmail.com> | 2023-12-29 12:06:38 +0100 |
commit | d76ac20e0e84a2ed098f50d8aed3def686ec9311 (patch) | |
tree | b6dad77dbe47b7967a9efdc27dd6169672e96854 /candle-book | |
parent | 5b12fbb1433f09a3aeee530420dae284719d96e9 (diff) | |
download | candle-d76ac20e0e84a2ed098f50d8aed3def686ec9311.tar.gz candle-d76ac20e0e84a2ed098f50d8aed3def686ec9311.tar.bz2 candle-d76ac20e0e84a2ed098f50d8aed3def686ec9311.zip |
Fix.
Diffstat (limited to 'candle-book')
-rw-r--r-- | candle-book/src/lib.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/candle-book/src/lib.rs b/candle-book/src/lib.rs index 576ea7f2..f8ca510d 100644 --- a/candle-book/src/lib.rs +++ b/candle-book/src/lib.rs @@ -28,6 +28,7 @@ let weights = candle::safetensors::load(weights_filename, &Device::Cpu).unwrap() #[rustfmt::skip] #[test] fn book_hub_2() { + { // ANCHOR: book_hub_2 use candle::Device; use hf_hub::api::sync::Api; @@ -43,11 +44,12 @@ let mmap = unsafe { Mmap::map(&file).unwrap() }; let weights = candle::safetensors::load_buffer(&mmap[..], &Device::Cpu).unwrap(); // ANCHOR_END: book_hub_2 assert_eq!(weights.len(), 206); - // } + } // #[rustfmt::skip] // #[test] // fn book_hub_3() { + { // ANCHOR: book_hub_3 use candle::{DType, Device, Tensor}; use hf_hub::api::sync::Api; @@ -102,6 +104,7 @@ let tp_tensor = Tensor::from_raw_buffer(&raw, dtype, &tp_shape, &Device::Cpu).un assert_eq!(view.shape(), &[768, 768]); assert_eq!(tp_tensor.dims(), &[192, 768]); } +} #[rustfmt::skip] #[test] |