Skip to content

Commit

Permalink
fix(mutagenesis): use lustre dir paths for more universal access #136
Browse files Browse the repository at this point in the history
Also fixed issue with huggingface caching
  • Loading branch information
jyaacoub committed Oct 24, 2024
1 parent 636a736 commit d438058
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion SBATCH/run_mutagenesis.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#SBATCH -t 10:00
#SBATCH -t 30:00
#SBATCH --job-name=run_mutagenesis_davis_esm
#SBATCH --mem=10G

Expand Down
4 changes: 2 additions & 2 deletions SBATCH/run_platinum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

# Then to get most accurate mutagenesis you can average these matrices
# and visualize them with src.analysis.mutagenesis_plot.plot_sequence

cd /home/jyaacoub/projects/def-sushant/jyaacoub/MutDTA
ROOT_DIR="/lustre06/project/6069023"
cd ${ROOT_DIR}/jyaacoub/MutDTA
source .venv/bin/activate

python -u run_platinum.py \
Expand Down
18 changes: 18 additions & 0 deletions SBATCH/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

ROOT_DIR="/lustre06/project/6069023"
SCRATCH_DIR="/lustre07/scratch/jyaacoub/" # this is used for outputs on narval
BIN_DIR="${ROOT_DIR}/jyaacoub/bin" # for modeller

# Modeller is needed for this to run... (see: Generic install - https://salilab.org/modeller/10.5/release.html#unix)
export PYTHONPATH="${PYTHONPATH}:${BIN_DIR}/modeller10.5/lib/x86_64-intel8/python3.3:${BIN_DIR}/modeller10.5/lib/x86_64-intel8:${BIN_DIR}/modeller10.5/modlib"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${BIN_DIR}/modeller10.5/lib/x86_64-intel8"

cd ${ROOT_DIR}/jyaacoub/MutDTA
source .venv/bin/activate

# export TRANSFORMERS_CACHE="${ROOT_DIR}/jyaacoub/hf_models/"
# export HF_HOME=${TRANSFORMERS_CACHE}
# export HF_HUB_OFFLINE=1

python -u playground.py
11 changes: 9 additions & 2 deletions playground.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
#%%
import os
print("os.env.TRANSFORMERS_CACHE - ", os.environ.get('TRANSFORMERS_CACHE'))
print(" os.env.HF_HOME - ", os.environ.get('HF_HOME'))
print(" os.env.HF_HUB_OFFLINE - ", os.environ.get('HF_HUB_OFFLINE'))

import torch
from tqdm import tqdm
import os
from src import cfg

from src.utils.loader import Loader
DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")

print("os.env - ", os.environ['HF_HOME'])
print("\n############### After imports: #############")
print("os.env.TRANSFORMERS_CACHE - ", os.environ['TRANSFORMERS_CACHE'])
print(" os.env.HF_HOME - ", os.environ['HF_HOME'])
print(" os.env.HF_HUB_OFFLINE - ", os.environ['HF_HUB_OFFLINE'])
m, _ = Loader.load_tuned_model('davis_esm', fold=0, device=DEVICE)
m.eval()

Expand Down

0 comments on commit d438058

Please sign in to comment.