Skip to content

Commit

Permalink
Clippy.
Browse files Browse the repository at this point in the history
  • Loading branch information
Narsil committed Aug 24, 2023
1 parent bf4e48b commit 6208f26
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,27 @@ jobs:
# with:
# name: pypi_files
# path: dist
build-sdist:
name: build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
rust-toolchain: stable
- name: Upload wheels
shell: bash
run: |
pip install awscli
aws s3 sync --exact-timestamps ./bindings/python/dist "s3://safetensors-releases/python/$DIST_DIR"
upload_package:
name: Upload package to PyPi
runs-on: ubuntu-latest
needs: [build]
needs: [build, build-sdist]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fn serialize<'b>(
metadata: Option<HashMap<String, String>>,
) -> PyResult<&'b PyBytes> {
let tensors = prepare(tensor_dict)?;
let metadata_map = metadata.map(|data| HashMap::from_iter(data.into_iter()));
let metadata_map = metadata.map(HashMap::from_iter);
let out = safetensors::tensor::serialize(&tensors, &metadata_map)
.map_err(|e| SafetensorError::new_err(format!("Error while serializing: {e:?}")))?;
let pybytes = PyBytes::new(py, &out);
Expand Down
2 changes: 1 addition & 1 deletion safetensors/src/tensor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ mod tests {
let mut start = 0;
let tensors: Vec<TensorInfo> = dtypes
.iter()
.zip(shapes.into_iter())
.zip(shapes)
.map(|(dtype, shape)| {
// This cannot overflow because the size of
// the vector and elements are so small.
Expand Down

0 comments on commit 6208f26

Please sign in to comment.