Installation¶

We recommend Python 3.8 or higher, PyTorch 1.11.0 or higher and transformers v4.32.0 or higher.

Install SentenceTransformers¶

Install with pip

Install the sentence-transformers with pip:

pip install -U sentence-transformers

Install with conda

Apple silicon Installation of sentence-transformers

conda install -c conda-forge sentence-transformers

Install from source

Alternatively, you can also clone the latest version from the repository and install it directly from the source code:

pip install -e .

Install PyTorch with CUDA support¶

If you want to use a GPU / CUDA, you must install PyTorch with the matching CUDA Version. Follow PyTorch - Get Started for further details how to install PyTorch.