Skip to content

Commit bbd6d61

Browse files
committed
rev safetensors to 0.6, float8 to 0.3
1 parent 86bcf1e commit bbd6d61

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ half = { version = "2.5.0", features = [
6262
"use-intrinsics",
6363
"rand_distr",
6464
] }
65-
float8 = { git = "https://github.com/zackangelo/float8", branch = "cudarc_0_16", features = [
66-
"num-traits",
67-
"rand_distr",
68-
] }
65+
float8 = { version = "0.3", features = ["num-traits", "rand_distr"] }
6966
hound = "3.5.1"
7067
image = { version = "0.25.2", default-features = false, features = [
7168
"jpeg",
@@ -82,7 +79,7 @@ parquet = { version = "51.0.0" }
8279
rand = "0.9.0"
8380
rand_distr = "0.5.1"
8481
rayon = "1.7.0"
85-
safetensors = "0.4.1"
82+
safetensors = "0.6"
8683
serde = { version = "1.0.171", features = ["derive"] }
8784
serde_plain = "1.0.2"
8885
serde_json = "1.0.99"

candle-core/src/safetensors.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl st::View for &Tensor {
9494
impl Tensor {
9595
pub fn save_safetensors<P: AsRef<Path>>(&self, name: &str, filename: P) -> Result<()> {
9696
let data = [(name, self.clone())];
97-
Ok(st::serialize_to_file(data, &None, filename.as_ref())?)
97+
Ok(st::serialize_to_file(data, None, filename.as_ref())?)
9898
}
9999
}
100100

@@ -232,6 +232,7 @@ fn convert(view: &st::TensorView<'_>, device: &Device) -> Result<Tensor> {
232232
st::Dtype::F16 => convert_::<half::f16>(view, device),
233233
st::Dtype::F32 => convert_::<f32>(view, device),
234234
st::Dtype::F64 => convert_::<f64>(view, device),
235+
st::Dtype::F8_E4M3 => convert_::<F8E4M3>(view, device),
235236
dtype => Err(Error::UnsupportedSafeTensorDtype(dtype)),
236237
}
237238
}
@@ -268,7 +269,7 @@ pub fn save<K: AsRef<str> + Ord + std::fmt::Display, P: AsRef<Path>>(
268269
tensors: &HashMap<K, Tensor>,
269270
filename: P,
270271
) -> Result<()> {
271-
Ok(st::serialize_to_file(tensors, &None, filename.as_ref())?)
272+
Ok(st::serialize_to_file(tensors, None, filename.as_ref())?)
272273
}
273274

274275
#[derive(yoke::Yokeable)]

0 commit comments

Comments
 (0)