Skip to content

Commit f5548ba

Browse files
iseeyuanmalfet
authored andcommitted
Automatically detect the cuda availability and install corresponding torch nightly (#605)
1 parent d7a4d24 commit f5548ba

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,13 @@ python3 -m venv .venv
5656
source .venv/bin/activate
5757
```
5858

59-
After the virtual environment is activated, dependencies can be installed. torchchat depends on pytorch. By default, torch nightly with cpu will be installed.
59+
After the virtual environment is activated, dependencies can be installed.
6060

6161
```bash
6262
# install dependencies
6363
./install_requirements.sh
6464
```
6565

66-
If CUDA GPUs are available, the argument of "cuda" can be added to accelerate the execution.
67-
68-
```bash
69-
# install dependencies
70-
./install_requirements.sh cuda
71-
```
72-
7366
Installations can be tested by
7467

7568
```bash

install_requirements.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,8 @@ NIGHTLY_VERSION=dev20240422
4444
# The pip repository that hosts nightly torch packages. cpu by default.
4545
TORCH_NIGHTLY_URL="https://download.pytorch.org/whl/nightly/cpu"
4646

47-
# If cuda is available, use "cuda" argument to install the pytorch nightly
48-
# with cuda for faster execution on cuda GPUs.
49-
if [ "$1" == "cuda" ]
50-
then
51-
TORCH_NIGHTLY_URL="https://download.pytorch.org/whl/nightly/cu121"
52-
fi
53-
47+
# If cuda is available, use the pytorch nightly with cuda for faster execution on cuda GPUs.
48+
test -f /usr/bin/nvidia-smi && TORCH_NIGHTLY_URL="https://download.pytorch.org/whl/nightly/cu121"
5449

5550
# pip packages needed by exir.
5651
REQUIREMENTS_TO_INSTALL=(

0 commit comments

Comments
 (0)