-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtesting-script.sh
executable file
·54 lines (45 loc) · 1.67 KB
/
testing-script.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
#!/bin/bash
set -euo pipefail
#Check CUDA is available, if CUDA is installed and nvcc is not available, install nvidia-cuda-toolkit.
nvcc --version
echo "For smoother execution, the output above should match Cuda compilation tools, release 12.3, V12.3.107\nBuild cuda_12.3.r12.3/compiler.33567101_0"
#Check that transformers and torch can be imported in python venv
# Check if the 'conda' command is available
if ! command -v conda &> /dev/null; then
echo "Activating Conda"
source ${CONDA_PREFIX}/bin/activate
conda activate venv
fi
conda list -n venv | grep transformers
conda list -n venv | grep torch
# Check the installation of libgl1-mesa-glx
if ! dpkg-query -W -f='${Status}' libgl1-mesa-glx 2>/dev/null | grep -q "install ok installed"; then
echo "Error: libgl1-mesa-glx is not installed. Install it with sudo apt-get install libgl1-mesa-glx. This is needed for gradient inversion experiments." >&2
else
echo "libgl1-mesa-glx is installed."
fi
result=True
echo "Checking models exist"
for dir in \
"$PWD/artifact_scripts/gradientInversion/rog/data/val" \
"$PWD/artifact_scripts/gradientInversion/rog/model_zoos"
do
if ! [ -d "$dir" ]; then
result=False
echo "${dir} model does not exist: check that the data.zip file is unzipped properly"
break
fi
done
result=True
echo "Checking three datasets exist"
for dir in \
"$PWD/eval/data/CIFAR10" \
"$PWD/eval/data/movielens" \
"$PWD/eval/data/sent140"
do
if ! [ -d "$dir" ]; then
result=False
echo "${dir} dataset does not exist: check that git-lfs is installed and pull the dataset from repo using it."
break
fi
done