Skip to content

Commit

Permalink
Added documentation of process of setting up the environment to run o…
Browse files Browse the repository at this point in the history
…n compute nodes. Added python script to download and save models from Huggingface.
  • Loading branch information
Tyler Sweat committed Feb 13, 2023
1 parent 86e7c1f commit 7035c6a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
8 changes: 8 additions & 0 deletions AttendExcite/save_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from pipeline_attend_and_excite import AttendAndExcitePipeline

model = input("Huggingface model to save: ")
modelname = input("Model name to save to ./models: ")

stable = AttendAndExcitePipeline.from_pretrained(model)

stable.save_pretrained(f"./models/{modelname}")
19 changes: 19 additions & 0 deletions BYURC_setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Environment setup for sending batch Attend and Excite jobs

If the `miniconda3` module is not yet loaded, run:
`module load miniconda3`

Create the latent diffusion model environment, `ldm`, by running:
`conda env create -f environment.yaml`

Add the following to `~/.bashrc`

```bash
# Activate ldm conda environment.
conda activate ldm

# Add LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/home/tysweat0/.conda/envs/ldm/lib
```

Run `StableComics/AttendExcite/save_model.py` to download the model locally. The compute nodes do not allow access to the Internet.
2 changes: 1 addition & 1 deletion run_attend_excite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#SBATCH -C pascal


cd ~/AttendExcite/
cd ~/StableComics/AttendExcite/

nvidia-smi --list-gpus
nvidia-smi --query-gpu=memory.total --format=csv
Expand Down

0 comments on commit 7035c6a

Please sign in to comment.