Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions bindings/python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use safetensors::View;
use std::borrow::Cow;
use std::collections::HashMap;
use std::fs::File;
use std::iter::FromIterator;
use std::ops::Bound;
use std::path::PathBuf;
use std::sync::Arc;
Expand Down Expand Up @@ -120,8 +119,7 @@ fn serialize<'b>(
metadata: Option<HashMap<String, String>>,
) -> PyResult<PyBound<'b, PyBytes>> {
let tensors = prepare(tensor_dict)?;
let metadata_map = metadata.map(HashMap::from_iter);
let out = safetensors::tensor::serialize(&tensors, &metadata_map)
let out = safetensors::tensor::serialize(&tensors, &metadata)
.map_err(|e| SafetensorError::new_err(format!("Error while serializing: {e:?}")))?;
let pybytes = PyBytes::new(py, &out);
Ok(pybytes)
Expand Down