-
Notifications
You must be signed in to change notification settings - Fork 13
/
install.sh
executable file
·52 lines (35 loc) · 1.47 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
set -e
set -o pipefail
echo "Start installation"
if ! command -v conda &> /dev/null
then
echo "conda could not be found, please ensure you've installed conda and place it in PATH."
exit
fi
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
conda create -y -n mcquic "python<3.12" pytorch-cuda "torchvision" "pytorch>2" -c pytorch -c nvidia
elif [[ "$OSTYPE" == "darwin"* ]]; then
conda create -y -n mcquic "python<3.12" "torchvision" "pytorch>2" -c pytorch
else
conda create -y -n mcquic "python<3.12" pytorch-cuda "torchvision" "pytorch>2" -c pytorch -c nvidia
fi
eval "$(conda shell.bash hook)"
conda activate mcquic
conda install -y -n mcquic gcc==9.4 gxx==9.4 "pybind11>=2.6,<3" "pip>=22" "tensorboard>=2.3,<3" "rich>=10,<11" "python-lmdb>=1.2,<2" "pyyaml>=5.4,<7" "marshmallow>=3.14,<4" "click>=8,<9" "msgpack-python>=1,<2" ninja packaging -c conda-forge
if [[ "$CONDA_DEFAULT_ENV" != "mcquic" ]]; then
echo "Can't activate conda env mcquic, exit."
exit
fi
ADD_ENTRY=SET PYPI_BUILDING=SET pip install -e .
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sed -i "1 s|$| -O|" "$(which mcquic)"*
elif [[ "$OSTYPE" == "darwin"* ]]; then
sed -i "" "1 s|$| -O|" "$(which mcquic)"*
else
sed -i "1 s|$| -O|" "$(which mcquic)"*
fi
pip install flash-attn --no-build-isolation
echo "Installation done!"
echo "If you want to train models, please install NVIDIA/Apex manually."
echo "If you want to use streamlit service, please install streamlit via pip."