Commit 4c9200c Anindyadeep
committed
1 parent 1dbd21f commit 4c9200c Copy full SHA for 4c9200c
File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -13,15 +13,28 @@ if [ "$#" -ne 1 ]; then
13
13
exit 1
14
14
fi
15
15
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
+
16
27
# Define directory paths
17
28
SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
18
29
VENV_DIR=" $SCRIPT_DIR /venv"
19
30
MODELS_FOLDER=" $1 "
20
31
LLAMA_HF_MODEL_DIR=" $MODELS_FOLDER /llama-2-7b-hf"
21
32
LLAMA_ONNX_MODEL_DIR=" $MODELS_FOLDER /llama-2-7b-onnx"
22
33
34
+ check_python
35
+
23
36
if [ ! -d " $VENV_DIR " ]; then
24
- python -m venv " $VENV_DIR "
37
+ " $PYTHON_CMD " -m venv " $VENV_DIR "
25
38
echo " Virtual environment '$VENV_DIR ' created."
26
39
# shellcheck disable=SC1091
27
40
source " $VENV_DIR /bin/activate"
You can’t perform that action at this time.
0 commit comments