diff --git a/ggml/src/lib.rs b/ggml/src/lib.rs index 03ed698a..89a6a32f 100644 --- a/ggml/src/lib.rs +++ b/ggml/src/lib.rs @@ -361,17 +361,17 @@ impl Tensor { }) } - /// Set the tensor's data pointer (useful for mmap-ed data) - /// - /// # Safety - /// - /// The memory region from `data_ptr` to `data_ptr.offset(tensor.nbytes())` will be read from. - pub unsafe fn set_data(&self, data_ptr: *mut c_void) { - self.with_alive_ctx(|| { - // SAFETY: The with_alive_call guarantees the context is alive - unsafe { *self.ptr.as_ptr() }.data = data_ptr; - }) - } + // /// Set the tensor's data pointer (useful for mmap-ed data) + // /// + // /// # Safety + // /// + // /// The memory region from `data_ptr` to `data_ptr.offset(tensor.nbytes())` will be read from. + // pub unsafe fn set_data(&self, data_ptr: *mut c_void) { + // self.with_alive_ctx(|| { + // // SAFETY: The with_alive_call guarantees the context is alive + // unsafe { *self.ptr.as_ptr() }.data = data_ptr; + // }) + // } /// Number of elements in this tensor. pub fn nelements(&self) -> usize { diff --git a/llama-rs/src/loader.rs b/llama-rs/src/loader.rs index fc3b2c61..e05483c8 100644 --- a/llama-rs/src/loader.rs +++ b/llama-rs/src/loader.rs @@ -173,7 +173,7 @@ pub(crate) fn load_weights_ggmf_or_unversioned( byte_size: total_size, tensor_count: n_tensors.try_into()?, }); - }; + } Ok(()) } @@ -264,7 +264,6 @@ fn load_tensor_header_ggmf<'a>( } fn tensor_type_size(ftype: i32, ne: [i64; 2]) -> Option { - match ftype { 0 => Some(ggml::type_size(ggml::Type::F32)), 1 => Some(ggml::type_size(ggml::Type::F16)),