-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·68 lines (57 loc) · 1.83 KB
/
setup.sh
File metadata and controls
executable file
·68 lines (57 loc) · 1.83 KB
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
68
#!/bin/bash
# Basic settings
PYTHON_VERSION="3.12"
REQUIREMENTS_FILE="requirements_grpo.txt"
VENV_DIR=".venv"
echo "=== Setting up Python environment ==="
# Install UV if not already installed
if ! command -v uv &> /dev/null; then
echo "uv not found. Pleasing install uv first."
fi
# Create virtual environment if it doesn't exist
if [ ! -d "$VENV_DIR" ]; then
echo "Creating virtual environment..."
uv venv --python $PYTHON_VERSION --seed
if [ $? -ne 0 ]; then
echo "Failed to create virtual environment"
exit 1
fi
else
echo "Virtual environment already exists. Reusing it."
fi
# Activate the virtual environment
echo "Activating virtual environment..."
source $VENV_DIR/bin/activate
# Check Python version
echo "Using Python $(python --version 2>&1)"
# Install dependencies
if [ -f "$REQUIREMENTS_FILE" ]; then
echo "Installing dependencies from ${REQUIREMENTS_FILE}..."
uv pip install -r $REQUIREMENTS_FILE
if [ $? -ne 0 ]; then
echo "Failed to install requirements"
exit 1
fi
fi
# Install additional packages
echo "Installing additional packages..."
uv pip install --upgrade pip setuptools wheel ninja
echo "Installing verl with vllm support..."
uv pip install -e .
if [ $? -ne 0 ]; then
echo "Failed to install verl"
exit 1
fi
# Install flash-attn
echo "Installing flash-attn..."
if ! uv pip install flash-attn --no-build-isolation; then
echo "flash-attn installation failed. CUDA toolkit may be required."
echo "Continuing without flash-attn..."
fi
# echo "Install flash-infer..."
# if ! uv pip install flashinfer-python==0.2.14.post1; then
# echo "flash-infer installation failed. CUDA toolkit may be required."
# echo "Continuing without flash-infer..."
# fi
echo "=== Environment setup complete ==="
echo "To activate environment: source $VENV_DIR/bin/activate"