]> khamidou — GitHub mirrors - safetensors.git/commitdiff
Add pip installation guide (#116)
authorPatrick von Platen <patrick.v.platen@gmail.com>
Mon, 28 Nov 2022 13:26:04 +0000 (14:26 +0100)
committerGitHub <noreply@github.com>
Mon, 28 Nov 2022 13:26:04 +0000 (14:26 +0100)
* Add pip installation guide

* Update the 3 locations.

* Those are not doctests.

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
README.md
safetensors/README.md
safetensors/src/lib.rs

index c452366054a76afe41b28b60051af742a74cd999..e854617e4a031e939cf4d1ae18b2e3d1fd887751 100644 (file)
--- a/README.md
+++ b/README.md
@@ -5,6 +5,30 @@
 This repository implements a new simple format for storing tensors
 safely (as opposed to pickle) and that is still fast (zero-copy).
 
+### Installation
+#### Pip
+
+You can install safetensors via the pip manager:
+
+```bash
+pip install safetensors
+```
+
+#### From source
+
+For the sources, you need Rust
+
+```bash
+# Install Rust
+curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
+# Make sure it's up to date and using stable channel
+rustup update
+git clone https://github.com/huggingface/safetensors
+cd safetensors/bindings/python
+pip install setuptools_rust
+pip install -e .
+```
+
 ### Getting started
 
 ```python
index c452366054a76afe41b28b60051af742a74cd999..e854617e4a031e939cf4d1ae18b2e3d1fd887751 100644 (file)
@@ -5,6 +5,30 @@
 This repository implements a new simple format for storing tensors
 safely (as opposed to pickle) and that is still fast (zero-copy).
 
+### Installation
+#### Pip
+
+You can install safetensors via the pip manager:
+
+```bash
+pip install safetensors
+```
+
+#### From source
+
+For the sources, you need Rust
+
+```bash
+# Install Rust
+curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
+# Make sure it's up to date and using stable channel
+rustup update
+git clone https://github.com/huggingface/safetensors
+cd safetensors/bindings/python
+pip install setuptools_rust
+pip install -e .
+```
+
 ### Getting started
 
 ```python
index d0c658836775c69d805735fb88822d39202bcd44..f1e91181f9146137f000bbefd49f45b26a35ddd3 100644 (file)
@@ -4,6 +4,30 @@
 //!This repository implements a new simple format for storing tensors
 //!safely (as opposed to pickle) and that is still fast (zero-copy).
 //!
+//!## Installation
+//!### Pip
+//!
+//! You can install safetensors via the pip manager:
+//!
+//! ```bash
+//! pip install safetensors
+//! ```
+//!
+//!### From source
+//!
+//!For the sources, you need Rust
+//!
+//!```bash
+//!# Install Rust
+//!curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
+//!# Make sure it's up to date and using stable channel
+//!rustup update
+//!git clone https://github.com/huggingface/safetensors
+//!cd safetensors/bindings/python
+//!pip install setuptools_rust
+//!pip install -e .
+//!```
+//!
 //!## Getting started
 //!
 //!```python