-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_env.sh
62 lines (47 loc) · 1.64 KB
/
setup_env.sh
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
# base=$(cd $(dirname -- $0); pwd)
# echo "$base"
# # if running on cluster, run
# module purge
# module load volta anaconda3 gcc/7.4.0 nvidia/cuda10.2-cudnn7.6.5
# # print loaded modules
# module list
# # make conda command available
# eval "$(conda shell.bash hook)"
# conda activate
# # create new clean environment
# conda create -n unsup_ctrl python=3.8 -y
# conda activate unsup_ctrl && echo "CONDA ENV: $CONDA_DEFAULT_ENV"
# pip install -r requirements.txt
# # depending on cuda driver, may need to install from whl, e.g.
# pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
# # for finetuning data preprocessing
# python -m spacy download en_core_web_sm
# # to run notebook from a server with ipython kernels, run
# python -m ipykernel install --user --name=unsup_ctrl
#################
## alternatively:
#################
# mkdir -p $base/src
# echo "Installing transformers..."
# cd $base/src
# git clone [email protected]:tannonk/transformers.git
# cd transformers
# git checkout unsup_cntrl
# pip install -e .
# cd $base/src
# echo "Installing fairseq..."
# git clone [email protected]:tannonk/fairseq.git
# cd fairseq
# git checkout minibart
# pip install --editable ./
# cd $base/src
## test install
# python -c 'import torch; print(torch.__version__)'
# echo "Installing apex..."
# cd $base/src
# git clone https://github.com/NVIDIA/apex
# cd apex
# pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" --global-option="--deprecated_fused_adam" --global-option="--xentropy" --global-option="--fast_multihead_attn" ./
# cd $base