You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-3Lines changed: 23 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -255,17 +255,37 @@ You should install 🤗 Transformers in a [virtual environment](https://docs.pyt
255
255
256
256
First, create a virtual environment with the version of Python you're going to use and activate it.
257
257
258
-
Then, you will need to install at least one of Flax, PyTorch, or TensorFlow.
259
-
Please refer to [TensorFlow installation page](https://www.tensorflow.org/install/), [PyTorch installation page](https://pytorch.org/get-started/locally/#start-locally) and/or [Flax](https://github.com/google/flax#quick-install) and [Jax](https://github.com/google/jax#installation) installation pages regarding the specific installation command for your platform.
258
+
**macOS/Linux**
259
+
260
+
```python -m venv env
261
+
source env/bin/activate
262
+
```
263
+
264
+
**Windows**
265
+
266
+
```python -m venv env
267
+
env\Scripts\activate
268
+
```
269
+
270
+
To use 🤗 Transformers, you must install at least one of Flax, PyTorch, or TensorFlow. Refer to the official installation guides for platform-specific commands:
[PyTorch installation page](https://pytorch.org/get-started/locally/#start-locally) and/or [Flax](https://github.com/google/flax#quick-install) and [Jax](https://github.com/google/jax#installation)
260
274
261
275
When one of those backends has been installed, 🤗 Transformers can be installed using pip as follows:
262
276
263
-
```bash
277
+
```
264
278
pip install transformers
265
279
```
266
280
267
281
If you'd like to play with the examples or need the bleeding edge of the code and can't wait for a new release, you must [install the library from source](https://huggingface.co/docs/transformers/installation#installing-from-source).
Copy file name to clipboardExpand all lines: docs/source/en/installation.md
+38-14Lines changed: 38 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,27 +32,18 @@ Install 🤗 Transformers for whichever deep learning library you're working wit
32
32
33
33
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.
34
34
35
-
Start by creating a virtual environment in your project directory:
35
+
Now you're ready to install 🤗 Transformers with the following command:
36
36
37
37
```bash
38
-
python -m venv .env
38
+
pip install transformers
39
39
```
40
40
41
-
Activate the virtual environment. On Linux and MacOs:
41
+
For GPU acceleration, install the appropriate CUDA drivers for [PyTorch](https://pytorch.org/get-started/locally)and TensorFlow(https://www.tensorflow.org/install/pip).
42
42
43
-
```bash
44
-
source .env/bin/activate
45
-
```
46
-
Activate Virtual environment on Windows
43
+
Run the command below to check if your system detects an NVIDIA GPU.
47
44
48
45
```bash
49
-
.env/Scripts/activate
50
-
```
51
-
52
-
Now you're ready to install 🤗 Transformers with the following command:
53
-
54
-
```bash
55
-
pip install transformers
46
+
nvidia-smi
56
47
```
57
48
58
49
For CPU-support only, you can conveniently install 🤗 Transformers and a deep learning library in one line. For example, install 🤗 Transformers and PyTorch with:
@@ -254,3 +245,36 @@ Once your file is downloaded and locally cached, specify it's local path to load
254
245
See the [How to download files from the Hub](https://huggingface.co/docs/hub/how-to-downstream) section for more details on downloading files stored on the Hub.
255
246
256
247
</Tip>
248
+
249
+
## Troubleshooting
250
+
251
+
See below for some of the more common installation issues and how to resolve them.
252
+
253
+
### Unsupported Python version
254
+
255
+
Ensure you are using Python 3.9or later. Run the command below to check your Python version.
256
+
257
+
```
258
+
python --version
259
+
```
260
+
261
+
### Missing dependencies
262
+
263
+
Install all required dependencies by running the following command. Ensure you’re in the project directory before executing the command.
264
+
265
+
```
266
+
pip install -r requirements.txt
267
+
```
268
+
269
+
### Windows-specific
270
+
271
+
If you encounter issues on Windows, you may need to activate Developer Mode. Navigate to Windows Settings > For Developers > Developer Mode.
272
+
273
+
Alternatively, create and activate a virtual environment as shown below.
0 commit comments