-
Notifications
You must be signed in to change notification settings - Fork 26
/
install.sh
executable file
·67 lines (56 loc) · 1.4 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
export TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0"
show_help() {
echo "Usage: $0 [options]"
echo "Options:"
echo " --vllm Install the vllm module"
echo " --sglang Install the sglang module"
echo " --bitblas Install the bitblas module"
echo " -h, --help Show this help message"
}
check_uv_version() {
python - <<EOF
from importlib.metadata import version, PackageNotFoundError
try:
print(version('uv'))
except PackageNotFoundError:
print('not found')
EOF
}
INSTALL_COMMAND="pip install -vvv --no-build-isolation ."
MODULES=""
# Parse arguments
while [[ $# -gt 0 ]]; do
case "$1" in
--vllm)
MODULES="${MODULES}vllm,"
shift
;;
--sglang)
MODULES="${MODULES}sglang,"
shift
;;
--bitblas)
MODULES="${MODULES}bitblas,"
shift
;;
-h|--help)
show_help
exit 0
;;
*)
echo "Unknown option: $1"
show_help
exit 1
;;
esac
done
MODULES=${MODULES%,}
if [ -n "$MODULES" ]; then
INSTALL_COMMAND="$INSTALL_COMMAND[$MODULES]"
fi
UV_VERSION=$(check_uv_version)
if [[ $UV_VERSION != "not found" && $(echo -e "$UV_VERSION\n0.1.16" | sort -V | head -n1) == "0.1.16" ]]; then
INSTALL_COMMAND="uv $INSTALL_COMMAND"
fi
$INSTALL_COMMAND