diff options
author | Laurent Mazare <laurent.mazare@gmail.com> | 2023-09-24 11:18:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-24 11:18:17 +0100 |
commit | 4aeb44901752022b0b22ee39fba146ece908ebe7 (patch) | |
tree | 2cb30a3a01126f4354ebf1b0b97bff27c653d4ff /candle-nn | |
parent | bcb0ed8f1c8982339ed78fe41dcd75521df90305 (diff) | |
download | candle-4aeb44901752022b0b22ee39fba146ece908ebe7.tar.gz candle-4aeb44901752022b0b22ee39fba146ece908ebe7.tar.bz2 candle-4aeb44901752022b0b22ee39fba146ece908ebe7.zip |
Depreate the VarBuilder::from_safetensors function. (#951)
Diffstat (limited to 'candle-nn')
-rw-r--r-- | candle-nn/src/var_builder.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/candle-nn/src/var_builder.rs b/candle-nn/src/var_builder.rs index 27cbb636..6e143615 100644 --- a/candle-nn/src/var_builder.rs +++ b/candle-nn/src/var_builder.rs @@ -1,6 +1,6 @@ //! A `VarBuilder` is used to retrieve variables used by a model. These variables can either come -//! from a pre-trained checkpoint, e.g. using `VarBuilder::from_safetensors`, or initialized for -//! training, e.g. using `VarBuilder::from_varmap`. +//! from a pre-trained checkpoint, e.g. using `VarBuilder::from_mmaped_safetensors`, or initialized +//! for training, e.g. using `VarBuilder::from_varmap`. use crate::VarMap; use candle::{safetensors::Load, DType, Device, Error, Result, Shape, Tensor}; use safetensors::{slice::IndexOp, tensor::SafeTensors}; @@ -414,6 +414,10 @@ impl<'a> VarBuilder<'a> { /// Initializes a `VarBuilder` that retrieves tensors stored in a collection of safetensors /// data. + #[deprecated( + since = "0.2.3", + note = "use from_mmaped_safetensors or from_buffered_safetensors instead" + )] pub fn from_safetensors(safetensors: Vec<SafeTensors<'a>>, dtype: DType, dev: &Device) -> Self { let mut routing = HashMap::new(); for (index, sf) in safetensors.iter().enumerate() { |