-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
executable file
·49 lines (37 loc) · 1.28 KB
/
setup.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
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Define colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Print colored output
print_green() {
echo -e "${GREEN}$1${NC}"
}
print_yellow() {
echo -e "${YELLOW}$1${NC}"
}
# Create a virtual environment
print_green "Creating virtual environment..."
python3 -m venv .venv
# Activate the virtual environment
print_green "Activating virtual environment..."
source .venv/bin/activate
# Upgrade pip
print_green "Upgrading pip..."
pip install --upgrade pip
# Install GPU-enabled JAX
print_green "Installing GPU-enabled JAX..."
pip install --upgrade "jax[cuda12_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
# Install other requirements
print_green "Installing other requirements..."
pip install transformers rich flax PyQt6 psutil
print_green "Setup complete!"
print_yellow "To activate the virtual environment, run:"
echo "source .venv/bin/activate"
print_yellow "To verify JAX is using the GPU, run:"
echo "python -c 'import jax; print(jax.devices())'"
print_yellow "If you see GPU devices listed, you're good to go. If not, you may need to set up CUDA manually."
print_yellow "Once the environment is activated, to run the program:"
echo "python main.py"