Skip to content

Commit 4e5cc1a

Browse files
revert
1 parent daf32f1 commit 4e5cc1a

File tree

2 files changed

+35
-35
lines changed

2 files changed

+35
-35
lines changed

cuda-all-entrypoint.sh

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
#!/bin/bash
22

33
if ! command -v nvidia-smi &> /dev/null; then
4-
# It does not matter which router we exec, the model will be served on CPU
4+
echo "Error: 'nvidia-smi' command not found."
5+
exit 1
6+
fi
7+
8+
compute_cap=$(nvidia-smi --query-gpu=compute_cap --format=csv | sed -n '2p' | sed 's/\.//g')
9+
10+
if [ ${compute_cap} -eq 75 ]
11+
then
512
exec text-embeddings-router-75 "$@"
13+
elif [ ${compute_cap} -ge 80 -a ${compute_cap} -lt 90 ]
14+
then
15+
exec text-embeddings-router-80 "$@"
16+
elif [ ${compute_cap} -eq 90 ]
17+
then
18+
exec text-embeddings-router-90 "$@"
619
else
7-
compute_cap=$(nvidia-smi --query-gpu=compute_cap --format=csv | sed -n '2p' | sed 's/\.//g')
8-
9-
if [ ${compute_cap} -eq 75 ]
10-
then
11-
exec text-embeddings-router-75 "$@"
12-
elif [ ${compute_cap} -ge 80 -a ${compute_cap} -lt 90 ]
13-
then
14-
exec text-embeddings-router-80 "$@"
15-
elif [ ${compute_cap} -eq 90 ]
16-
then
17-
exec text-embeddings-router-90 "$@"
18-
else
19-
echo "cuda compute cap ${compute_cap} is not supported"; exit 1
20-
fi
20+
echo "cuda compute cap ${compute_cap} is not supported"; exit 1
2121
fi

sagemaker-entrypoint-cuda-all.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ if [[ -n "${HF_MODEL_REVISION}" ]]; then
1111
fi
1212

1313
if ! command -v nvidia-smi &> /dev/null; then
14-
# It does not matter which router we exec, the model will be served on CPU
15-
text-embeddings-router-75 --port 8080 --json-output
14+
echo "Error: 'nvidia-smi' command not found."
15+
exit 1
16+
fi
17+
18+
if [[ -z "${CUDA_COMPUTE_CAP}" ]]
19+
then
20+
compute_cap=$(nvidia-smi --query-gpu=compute_cap --format=csv | sed -n '2p' | sed 's/\.//g')
1621
else
17-
if [[ -z "${CUDA_COMPUTE_CAP}" ]]
18-
then
19-
compute_cap=$(nvidia-smi --query-gpu=compute_cap --format=csv | sed -n '2p' | sed 's/\.//g')
20-
else
21-
compute_cap=$CUDA_COMPUTE_CAP
22-
fi
22+
compute_cap=$CUDA_COMPUTE_CAP
23+
fi
2324

24-
if [[ ${compute_cap} -eq 75 ]]
25-
then
26-
text-embeddings-router-75 --port 8080 --json-output
27-
elif [[ ${compute_cap} -ge 80 && ${compute_cap} -lt 90 ]]
28-
then
29-
text-embeddings-router-80 --port 8080 --json-output
30-
elif [[ ${compute_cap} -eq 90 ]]
31-
then
32-
text-embeddings-router-90 --port 8080 --json-output
33-
else
34-
echo "cuda compute cap ${compute_cap} is not supported"; exit 1
35-
fi
25+
if [[ ${compute_cap} -eq 75 ]]
26+
then
27+
text-embeddings-router-75 --port 8080 --json-output
28+
elif [[ ${compute_cap} -ge 80 && ${compute_cap} -lt 90 ]]
29+
then
30+
text-embeddings-router-80 --port 8080 --json-output
31+
elif [[ ${compute_cap} -eq 90 ]]
32+
then
33+
text-embeddings-router-90 --port 8080 --json-output
34+
else
35+
echo "cuda compute cap ${compute_cap} is not supported"; exit 1
3636
fi

0 commit comments

Comments
 (0)