Skip to content

Commit

Permalink
add installation for packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
kamo-naoyuki committed May 12, 2022
1 parent 8fbac77 commit 86186b7
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/installers/install_chainer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ if [ "${cuda_version}" = cpu ] || [ "${cuda_version}" = CPU ]; then
fi


if ! python -c "import packaging.version" &> /dev/null; then
python3 -m pip install packaging
fi
# espnet requires chiner=6.0.0
chainer_version=6.0.0
python_version=$(python3 -c "import sys; print(sys.version.split()[0])")
Expand Down
3 changes: 3 additions & 0 deletions tools/installers/install_fairscale.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ if [ $# != 0 ]; then
exit 1;
fi

if ! python -c "import packaging.version" &> /dev/null; then
python3 -m pip install packaging
fi
torch_version=$(python3 -c "import torch; print(torch.__version__)")
python_36_plus=$(python3 <<EOF
from packaging.version import parse as V
Expand Down
3 changes: 3 additions & 0 deletions tools/installers/install_fairseq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ if [ $# != 0 ]; then
exit 1;
fi

if ! python -c "import packaging.version" &> /dev/null; then
python3 -m pip install packaging
fi
torch_version=$(python3 -c "import torch; print(torch.__version__)")
python_36_plus=$(python3 <<EOF
from packaging.version import parse as V
Expand Down
3 changes: 3 additions & 0 deletions tools/installers/install_k2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ else
use_conda=$([[ $(conda list -e -c -f --no-pip pytorch 2>/dev/null) =~ pytorch ]] && echo true || echo false)
fi

if ! python -c "import packaging.version" &> /dev/null; then
python3 -m pip install packaging
fi

python_36_plus=$(python3 <<EOF
from packaging.version import parse as V
Expand Down
3 changes: 3 additions & 0 deletions tools/installers/install_longformer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ if [ $# != 0 ]; then
exit 1;
fi

if ! python -c "import packaging.version" &> /dev/null; then
python3 -m pip install packaging
fi
torch_version=$(python3 -c "import torch; print(torch.__version__)")
python_36_plus=$(python3 <<EOF
from packaging.version import parse as V
Expand Down
3 changes: 3 additions & 0 deletions tools/installers/install_s3prl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ if [ $# != 0 ]; then
exit 1;
fi

if ! python -c "import packaging.version" &> /dev/null; then
python3 -m pip install packaging
fi
torch_17_plus=$(python3 <<EOF
from packaging.version import parse as V
import torch
Expand Down
3 changes: 3 additions & 0 deletions tools/installers/install_speechbrain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ if [ $# != 0 ]; then
exit 1;
fi

if ! python -c "import packaging.version" &> /dev/null; then
python3 -m pip install packaging
fi
torch_18_plus=$(python3 <<EOF
from packaging.version import parse as V
import torch
Expand Down
3 changes: 3 additions & 0 deletions tools/installers/install_torch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ log "[INFO] python_version=${python_version}"
log "[INFO] torch_version=${torch_version}"
log "[INFO] cuda_version=${cuda_version}"

if ! python -c "import packaging.version" &> /dev/null; then
python3 -m pip install packaging
fi

if $(pytorch_plus 1.11.1); then
log "[ERROR] This script doesn't support pytorch=${torch_version}"
Expand Down
3 changes: 3 additions & 0 deletions tools/installers/install_torch_optimizer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ if [ $# != 0 ]; then
exit 1;
fi

if ! python -c "import packaging.version" &> /dev/null; then
python3 -m pip install packaging
fi
torch_version=$(python3 -c "import torch; print(torch.__version__)")
python_36_plus=$(python3 <<EOF
from packaging.version import parse as V
Expand Down
3 changes: 3 additions & 0 deletions tools/installers/install_warp-ctc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ if [ $# != 0 ]; then
exit 1;
fi

if ! python -c "import packaging.version" &> /dev/null; then
python3 -m pip install packaging
fi
torch_17_plus=$(python3 <<EOF
from packaging.version import parse as V
import torch
Expand Down
3 changes: 3 additions & 0 deletions tools/installers/install_warp-transducer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ if [ $# != 0 ]; then
exit 1;
fi

if ! python -c "import packaging.version" &> /dev/null; then
python3 -m pip install packaging
fi
# TODO(kamo): Consider clang case
# Note: Requires gcc>=4.9.2 to build extensions with pytorch>=1.0
if python3 -c 'import torch as t;assert t.__version__[0] == "1"' &> /dev/null; then \
Expand Down

0 comments on commit 86186b7

Please sign in to comment.