Skip to content

Commit 4c9200c

Browse files
author
Anindyadeep
committed
python aliases support in setup
1 parent 1dbd21f commit 4c9200c

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

bench_onnxruntime/setup.sh

+14-1
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,28 @@ if [ "$#" -ne 1 ]; then
1313
exit 1
1414
fi
1515

16+
check_python() {
17+
if command -v python &> /dev/null; then
18+
PYTHON_CMD="python"
19+
elif command -v python3 &> /dev/null; then
20+
PYTHON_CMD="python3"
21+
else
22+
echo "Python is not installed."
23+
exit 1
24+
fi
25+
}
26+
1627
# Define directory paths
1728
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1829
VENV_DIR="$SCRIPT_DIR/venv"
1930
MODELS_FOLDER="$1"
2031
LLAMA_HF_MODEL_DIR="$MODELS_FOLDER/llama-2-7b-hf"
2132
LLAMA_ONNX_MODEL_DIR="$MODELS_FOLDER/llama-2-7b-onnx"
2233

34+
check_python
35+
2336
if [ ! -d "$VENV_DIR" ]; then
24-
python -m venv "$VENV_DIR"
37+
"$PYTHON_CMD" -m venv "$VENV_DIR"
2538
echo "Virtual environment '$VENV_DIR' created."
2639
# shellcheck disable=SC1091
2740
source "$VENV_DIR/bin/activate"

0 commit comments

Comments
 (0)