]> khamidou — GitHub mirrors - safetensors.git/commitdiff
Removing old doc. (#427)
authorNicolas Patry <patry.nicolas@protonmail.com>
Wed, 17 Jan 2024 16:38:44 +0000 (17:38 +0100)
committerGitHub <noreply@github.com>
Wed, 17 Jan 2024 16:38:44 +0000 (17:38 +0100)
* Removing old doc.

* Update pyo3 to get clippy happy.

* Optional MLX install.

* Mlx only on python 3.10.

.github/workflows/python.yml
bindings/python/Cargo.toml
bindings/python/py_src/safetensors/flax.py
bindings/python/py_src/safetensors/numpy.py
bindings/python/py_src/safetensors/tensorflow.py
bindings/python/pyproject.toml

index ba0a1a7a26dbce4e9b02edad4e6ad0d480027e3f..cb418f289b9ceeb20f62a714fa543f732dbf62ca 100644 (file)
@@ -58,6 +58,12 @@ jobs:
           pip install .[jax]
         shell: bash
 
+      - name: Install (mlx)
+        if: matrix.os == 'macos-latest' && matrix.version.python == "3.10"
+        run: |
+          pip install .[mlx]
+        shell: bash
+
       - name: Check style
         run: |
           pip install .[quality]
index 5274ae9c4fa2a5d989ca2685f689e5019561e9f7..78220ae2be4262d74be90a556155b97128d0c29e 100644 (file)
@@ -9,7 +9,7 @@ name = "safetensors_rust"
 crate-type = ["cdylib"]
 
 [dependencies]
-pyo3 = { version = "0.19.2", features = ["extension-module"] }
+pyo3 = { version = "0.20.2", features = ["extension-module"] }
 memmap2 = "0.5"
 serde_json = "1.0"
 
index 208264ab020cd05a31d1db8af6ee5fc2f005d436..aa906273dc3840a6567d493c58798b764dafefe1 100644 (file)
@@ -106,9 +106,6 @@ def load_file(filename: Union[str, os.PathLike]) -> Dict[str, Array]:
     Args:
         filename (`str`, or `os.PathLike`)):
             The name of the file which contains the tensors
-        device (`Dict[str, any]`, *optional*, defaults to `cpu`):
-            The device where the tensors need to be located after load.
-            available options are all regular flax device locations
 
     Returns:
         `Dict[str, Array]`: dictionary that contains name as key, value as `Array`
index 71814afc16a81ec4bdaac05ab91a38ff9cdf137e..a852ff351a4c2c61b3435b4eee831fca11532f28 100644 (file)
@@ -111,9 +111,6 @@ def load_file(filename: Union[str, os.PathLike]) -> Dict[str, np.ndarray]:
     Args:
         filename (`str`, or `os.PathLike`)):
             The name of the file which contains the tensors
-        device (`Dict[str, any]`, *optional*, defaults to `cpu`):
-            The device where the tensors need to be located after load.
-            available options are all regular numpy device locations
 
     Returns:
         `Dict[str, np.ndarray]`: dictionary that contains name as key, value as `np.ndarray`
index 449d5157ed9f5eba47b5a0d82cc8d2c7b97a5efa..65b8aeb469b3ee56e14a3f6df57ca4d8689d0e92 100644 (file)
@@ -105,9 +105,6 @@ def load_file(filename: Union[str, os.PathLike]) -> Dict[str, tf.Tensor]:
     Args:
         filename (`str`, or `os.PathLike`)):
             The name of the file which contains the tensors
-        device (`Dict[str, any]`, *optional*, defaults to `cpu`):
-            The device where the tensors need to be located after load.
-            available options are all regular tensorflow device locations
 
     Returns:
         `Dict[str, tf.Tensor]`: dictionary that contains name as key, value as `tf.Tensor`
index e6156c38a2220f16665d668f8b4d1ff5027a2807..306da13246f3216c5303595a06f6e0cd510188f8 100644 (file)
@@ -50,6 +50,9 @@ jax = [
     "jax>=0.3.25",
     "jaxlib>=0.3.25",
 ]
+mlx = [
+    "mlx>=0.0.9",
+]
 paddlepaddle = [
     "safetensors[numpy]",
     "paddlepaddle>=2.4.1",