docker_test5 / run.sh
jingyangcarl's picture
update
6b2d3c7
raw
history blame
902 Bytes
#!/bin/bash
set -e # stop on error
eval "$(conda shell.bash hook)"
ENV_NAME="matgen-plus"
PYTHON_VER="3.11"
# Create env and install packages only if it doesn't exist
if ! conda env list | grep -q "^${ENV_NAME}\s"; then
echo "Creating conda environment: $ENV_NAME"
conda create -y -n "$ENV_NAME" python="$PYTHON_VER"
conda activate "$ENV_NAME"
echo "Installing packages in $ENV_NAME..."
# pip installs
pip install diffusers["torch"] transformers accelerate xformers
pip install gradio controlnet-aux
pip install trimesh xatlas scikit-learn opencv-python omegaconf
# conda installs
# conda install -y pytorch3d -c pytorch -c conda-forge
# conda install -y -c conda-forge open-clip-torch pytorch-lightning
python app.py
else
echo "Conda environment '$ENV_NAME' already exists."
conda activate "$ENV_NAME"
fi
# Run the app
# python app.py