Skip to content

Commit 01742fc

Browse files
committed
Update setup script and readme
1 parent a6278e5 commit 01742fc

File tree

2 files changed

+41
-30
lines changed

2 files changed

+41
-30
lines changed

README.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# OmniChain - External Python Module (Beta)
1+
# OmniChain - External Python Module
22

3-
This is the repo for OmniChain's external Python module.
4-
5-
### Links:
6-
7-
- [Getting started](https://omnichain.zenoverflow.com)
8-
9-
- TODO: setup, docs
3+
This is a Python-based server meant to be used alongside [OmniChain](https://omnichain.zenoverflow.com) in order to provide Python-exclusive functionality.

setup.sh

+39-22
Original file line numberDiff line numberDiff line change
@@ -156,31 +156,48 @@ if [ $? -ne 0 ]; then
156156
fi
157157

158158
# Install pytorch for the specified device (cpu/cuda/rocm)
159-
if [ $INFERENCE_DEVICE == "cpu" ]; then
160-
conda install --update-all -y pytorch torchvision torchaudio cpuonly -c pytorch
161-
elif [ $INFERENCE_DEVICE == "cuda" ]; then
162-
conda install --update-all -y pytorch torchvision torchaudio pytorch-cuda=$CUDA_VERSION -c pytorch -c nvidia
163-
elif [ $INFERENCE_DEVICE == "rocm" ]; then
164-
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.1
165-
else
166-
echo "Invalid inference device"
167-
exit 1
168-
fi
159+
if [ $OPERATING_SYSTEM == "Darwin" ]; then
160+
conda install --update-all -y pytorch::pytorch torchvision torchaudio -c pytorch
169161

170-
# Exit if pytorch installation failed
171-
if [ $? -ne 0 ]; then
172-
echo "PyTorch installation failed"
173-
exit 1
174-
fi
162+
# Exit if pytorch installation failed
163+
if [ $? -ne 0 ]; then
164+
echo "PyTorch installation failed"
165+
exit 1
166+
fi
167+
elif [ $OPERATING_SYSTEM == "Linux" ]; then
168+
if [ $INFERENCE_DEVICE == "cpu" ]; then
169+
conda install --update-all -y pytorch torchvision torchaudio cpuonly -c pytorch
170+
elif [ $INFERENCE_DEVICE == "cuda" ]; then
171+
conda install --update-all -y pytorch torchvision torchaudio pytorch-cuda=$CUDA_VERSION -c pytorch -c nvidia
172+
173+
# Exit if pytorch installation failed
174+
if [ $? -ne 0 ]; then
175+
echo "PyTorch installation failed"
176+
exit 1
177+
fi
175178

176-
# If using CUDA, install CUDA and cuDNN stuff via conda
177-
if [ $INFERENCE_DEVICE == "cuda" ]; then
178-
conda install --update-all -y nvidia/label/cuda-$CUDA_VERSION.0::cuda cudnn=8.9.2.26 -c nvidia
179-
fi
179+
# Also install CUDA and cuDNN via conda
180+
conda install --update-all -y nvidia/label/cuda-$CUDA_VERSION.0::cuda cudnn=8.9.2.26 -c nvidia
180181

181-
# Exit if CUDA installation failed
182-
if [ $? -ne 0 ]; then
183-
echo "CUDA installation failed"
182+
# Exit if CUDA installation failed
183+
if [ $? -ne 0 ]; then
184+
echo "CUDA installation failed"
185+
exit 1
186+
fi
187+
elif [ $INFERENCE_DEVICE == "rocm" ]; then
188+
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.1
189+
else
190+
echo "Invalid inference device"
191+
exit 1
192+
fi
193+
194+
# Exit if pytorch installation failed
195+
if [ $? -ne 0 ]; then
196+
echo "PyTorch installation failed"
197+
exit 1
198+
fi
199+
else
200+
echo "Unsupported operating system"
184201
exit 1
185202
fi
186203

0 commit comments

Comments
 (0)