-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_env.sh
More file actions
executable file
·30 lines (22 loc) · 856 Bytes
/
Copy pathsetup_env.sh
File metadata and controls
executable file
·30 lines (22 loc) · 856 Bytes
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
#!/bin/bash
module load miniconda
ENV_NAME="${ENV_NAME:-rag_env}"
DEFAULT_PROJECT_ROOT="/projectnb/cs505am/students/$USER/zukhriddin_nlp_research_project"
if [[ ! -d "$DEFAULT_PROJECT_ROOT" && -d "/projectnb/cs505am/students/$USER/nlp_research_project" ]]; then
DEFAULT_PROJECT_ROOT="/projectnb/cs505am/students/$USER/nlp_research_project"
fi
if conda env list | grep -q "$ENV_NAME"; then
echo "Environment already exists."
else
echo "Creating environment..."
conda env create -n $ENV_NAME -f environment.yml
fi
conda activate $ENV_NAME
export HF_HOME="${HF_HOME:-/projectnb/cs505am/students/$USER/.cache/huggingface/}"
mkdir -p "$HF_HOME"
echo "Project root default: ${NLP_PROJECT_USER_ROOT:-$DEFAULT_PROJECT_ROOT}"
echo "HF_HOME set to $HF_HOME"
python - <<EOF
import torch
print("CUDA available:", torch.cuda.is_available())
EOF