Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/sh

# Changes the working directory to the one where the bash script is located.
cd $(dirname -- $(readlink -fn -- "$0"))

if [ "$(uname)" = "Darwin" ]; then
# macOS specific env:
export PYTORCH_ENABLE_MPS_FALLBACK=1
Expand All @@ -17,13 +20,17 @@ else
requirements_file="requirements.txt"

# Check if Python 3.8 is installed
if ! command -v python3.8 >/dev/null 2>&1 || pyenv versions --bare | grep -q "3.8"; then
if ! command -v python3.8 >/dev/null 2>&1 || pyenv version --bare | grep -qv "3.8"; then
echo "Python 3 not found. Attempting to install 3.8..."
if [ "$(uname)" = "Darwin" ] && command -v brew >/dev/null 2>&1; then
brew install [email protected]
elif [ "$(uname)" = "Linux" ] && command -v apt-get >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install python3.8
elif [ "$(uname)" = "Linux" ] && command -v pyenv >/dev/null 2>&1; then
pyenv install 3.8
pyenv local 3.8
alias python3.8=python
else
echo "Please install Python 3.8 manually."
exit 1
Expand Down