From: Patrick von Platen Date: Mon, 28 Nov 2022 13:26:04 +0000 (+0100) Subject: Add pip installation guide (#116) X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=aaac76dfea9dedb43a810b388b5266a889668c13;p=safetensors.git Add pip installation guide (#116) * Add pip installation guide * Update the 3 locations. * Those are not doctests. Co-authored-by: Nicolas Patry --- diff --git a/README.md b/README.md index c452366..e854617 100644 --- 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 diff --git a/safetensors/README.md b/safetensors/README.md index c452366..e854617 100644 --- a/safetensors/README.md +++ b/safetensors/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 diff --git a/safetensors/src/lib.rs b/safetensors/src/lib.rs index d0c6588..f1e9118 100644 --- a/safetensors/src/lib.rs +++ b/safetensors/src/lib.rs @@ -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