-
Notifications
You must be signed in to change notification settings - Fork 0
/
venv_gpt2_create.sh
executable file
·67 lines (51 loc) · 1.38 KB
/
venv_gpt2_create.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
63
64
65
66
67
#!/bin/bash
CYAN="$(tput setaf 6)"
WHITE="$(tput setaf 7)"
print(){
echo -n "${CYAN}"
echo $@
echo -n "${WHITE}"
}
base_dir=`pwd`
env_name="gpt2-venv"
rm -rf $env_name
print Upgrading OS
sudo apt update
sudo apt -y upgrade
sudo apt-get install libatlas-base-dev
# python_version variable will be for system's main Python installation
python_version=$(which python3.7)
print Upgrading pip
$python_version -m pip install --upgrade pip --user -q
print Installing virtualenv
$python_version -m pip install virtualenv -q
print Creating virtual environment
$python_version -m virtualenv -p $python_version $env_name
print Activating virtual environment
source $env_name/bin/activate
print Upgrading pip
python -m pip install --upgrade pip -q
print Creating requirements file
cat << EOF > requirements.txt
tensorflow==1.13.1
gpt2-client
autopep8
EOF
print Installing requirements
python -m pip install -r requirements.txt
cd $env_name
print Cloning gpt-2 git repo
git clone https://github.com/openai/gpt-2
cd gpt-2
print Installing gpt-2 requirements
python -m pip install -r requirements.txt
print Downloading gpt-2 124M model
python ./download_model.py 124M
print
print
print Activate environment with:
print source ${base_dir}/${env_name}/bin/activate
print
print Then run demo with...
print cd ${base_dir}/${env_name}/gpt-2/
print python -W ignore src/interactive_conditional_samples.py