-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup_env.sh
More file actions
29 lines (23 loc) · 795 Bytes
/
setup_env.sh
File metadata and controls
29 lines (23 loc) · 795 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
#!/bin/bash
# Shell script to set environment variables when running code in this repository.
# Usage:
# source setup_env.sh
# Activate conda env
# shellcheck source=${HOME}/.bashrc disable=SC1091
source "${CONDA_SHELL}"
if [ -z "${CONDA_PREFIX}" ]; then
conda activate dllm-dev
elif [[ "${CONDA_PREFIX}" != *"/dllm-dev" ]]; then
conda deactivate
conda activate dllm-dev
fi
# W&B / HF Setup
source "${HOME}/setup_discdiff.sh"
export HF_HOME="${PWD}/.hf_cache"
echo "HuggingFace cache set to '${HF_HOME}'."
# Add root directory to PYTHONPATH to enable module imports
export PYTHONPATH="${PWD}:${HF_HOME}/modules"
# Enforce verbose Hydra error logging
export HYDRA_FULL_ERROR=1
# export TMPDIR="${PWD}/.tmp" # TODO: currently this is causing OSErrors
export NCCL_P2P_LEVEL=NVL