From aaac76dfea9dedb43a810b388b5266a889668c13 Mon Sep 17 00:00:00 2001 From: Patrick von Platen Date: Mon, 28 Nov 2022 14:26:04 +0100 Subject: [PATCH] Add pip installation guide (#116) * Add pip installation guide * Update the 3 locations. * Those are not doctests. Co-authored-by: Nicolas Patry --- README.md | 24 ++++++++++++++++++++++++ safetensors/README.md | 24 ++++++++++++++++++++++++ safetensors/src/lib.rs | 24 ++++++++++++++++++++++++ 3 files changed, 72 insertions(+) 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 -- 2.43.0