Skip to content

Commit dbfa9a2

Browse files
committed
Use python3 vs python (#268)
As on some OSes (MacOS for example, or Ubuntu) `python` alias is missing by default, but `python3` is usually pre-installed On Ubuntu `python` alias is also missing unless `python-is-python3` is installed
1 parent a996fe3 commit dbfa9a2

File tree

7 files changed

+47
-47
lines changed

7 files changed

+47
-47
lines changed

.ci/scripts/convert_checkpoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function convert_checkpoint() {
2727
return 0
2828
fi
2929
echo "Convert Huggingface checkpoint for $MODEL_REPO"
30-
python scripts/convert_hf_checkpoint.py --checkpoint-dir "checkpoints/$MODEL_REPO"
30+
python3 scripts/convert_hf_checkpoint.py --checkpoint-dir "checkpoints/$MODEL_REPO"
3131
}
3232

3333

.ci/scripts/gather_test_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
# Copyright (c) Meta Platforms, Inc. and affiliates.
33
# All rights reserved.
44
#

.ci/scripts/validate.sh

Lines changed: 34 additions & 34 deletions
Large diffs are not rendered by default.

scripts/install_et.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ set -exu
1010
install_pip_dependencies() {
1111
echo "Intalling common pip packages"
1212

13-
pip install wheel
14-
pip install "cmake>=3.19"
15-
pip install ninja
16-
pip install zstd
13+
pip3 install wheel
14+
pip3 install "cmake>=3.19"
15+
pip3 install ninja
16+
pip3 install zstd
1717
pushd ${TORCHCHAT_ROOT}
18-
pip install -r ./requirements.txt
18+
pip3 install -r ./requirements.txt
1919
popd
2020
}
2121

@@ -44,7 +44,7 @@ install_executorch() {
4444
echo "Installing pybind"
4545
bash ./install_requirements.sh --pybind xnnpack
4646
fi
47-
pip list
47+
pip3 list
4848

4949
echo "Building and installing C++ libraries"
5050
echo "Inside: ${PWD}"

scripts/prepare.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
python scripts/download.py --repo-id $1 && python scripts/convert_hf_checkpoint.py --checkpoint-dir checkpoints/$1
1+
python3 scripts/download.py --repo-id $1 && python3 scripts/convert_hf_checkpoint.py --checkpoint-dir checkpoints/$1

scripts/test_flow.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export MODEL_REPO=meta-llama/Llama-2-7b-chat-hf
22
rm -r checkpoints/$MODEL_REPO
3-
python scripts/download.py --repo-id $MODEL_REPO
4-
python scripts/convert_hf_checkpoint.py --checkpoint-dir checkpoints/$MODEL_REPO
5-
python generate.py --compile --checkpoint-path checkpoints/$MODEL_REPO/model.pth --max-new-tokens 100
3+
python3 scripts/download.py --repo-id $MODEL_REPO
4+
python3 scripts/convert_hf_checkpoint.py --checkpoint-dir checkpoints/$MODEL_REPO
5+
python3 generate.py --compile --checkpoint-path checkpoints/$MODEL_REPO/model.pth --max-new-tokens 100

scripts/workflow.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function download_checkpoint() {
5151
if [ "$FORCE_DOWNLOAD" = true ] || [ ! -d "$CHECKPOINT_DIR" ] || [ -z "$(ls -A "$CHECKPOINT_DIR")" ]; then
5252
echo "Download checkpoint for $MODEL_REPO"
5353
rm -rf "$CHECKPOINT_DIR"
54-
python scripts/download.py --repo-id "$MODEL_REPO"
54+
python3 scripts/download.py --repo-id "$MODEL_REPO"
5555
else
5656
echo "Checkpoint directory for $MODEL_REPO is not empty. Skipping download."
5757
fi

0 commit comments

Comments
 (0)