From c550a1c6404664734f4607eacf44b1a3b100bca2 Mon Sep 17 00:00:00 2001 From: Steven Liu <59462357+stevhliu@users.noreply.github.com> Date: Mon, 27 Jan 2025 08:49:28 -0800 Subject: [PATCH] [docs] uv install (#35821) uv install --- docs/source/en/installation.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/source/en/installation.md b/docs/source/en/installation.md index ae1f2101d7..4573efbb43 100644 --- a/docs/source/en/installation.md +++ b/docs/source/en/installation.md @@ -32,12 +32,32 @@ Install 🤗 Transformers for whichever deep learning library you're working wit You should install 🤗 Transformers in a [virtual environment](https://docs.python.org/3/library/venv.html). If you're unfamiliar with Python virtual environments, take a look at this [guide](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/). A virtual environment makes it easier to manage different projects, and avoid compatibility issues between dependencies. -Now you're ready to install 🤗 Transformers with the following command: +Create a virtual environment with [uv](https://docs.astral.sh/uv/) (refer to [Installation](https://docs.astral.sh/uv/getting-started/installation/) for installation instructions), a fast Rust-based Python package and project manager. + +```bash +uv venv my-env +source my-env/bin/activate +``` + +Now you're ready to install 🤗 Transformers with pip or uv. + + + + +```bash +uv pip install transformers +``` + + + ```bash pip install transformers ``` + + + For GPU acceleration, install the appropriate CUDA drivers for [PyTorch](https://pytorch.org/get-started/locally) and TensorFlow(https://www.tensorflow.org/install/pip). Run the command below to check if your system detects an NVIDIA GPU.