File size: 902 Bytes
6b2d3c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/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