-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·36 lines (28 loc) · 1.12 KB
/
build.sh
File metadata and controls
executable file
·36 lines (28 loc) · 1.12 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
#!/usr/bin/env bash
# Exit on error
set -o errexit
# Print Python version for debugging
echo "Python version:"
python --version
echo "Pip version:"
pip --version
# Favor wheels and avoid isolated build envs that miss setuptools
export PIP_PREFER_BINARY=1
export PIP_NO_BUILD_ISOLATION=1
# Ensure we have the latest build tools
echo "Installing build tools..."
python -m pip install --upgrade pip==25.2
python -m pip install --upgrade setuptools>=70.0.0 wheel>=0.41.0
# Always use requirements.txt for installation on Railway
REQUIREMENTS_FILE="requirements.txt"
echo "Using ${REQUIREMENTS_FILE} for installation..."
# Install PyTorch CPU version first to avoid memory issues
echo "Installing PyTorch CPU version..."
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
# Install the rest of the requirements
echo "Installing remaining requirements from $REQUIREMENTS_FILE..."
python -m pip install -r $REQUIREMENTS_FILE
# Download NLTK data if needed
echo "Downloading NLTK data if needed..."
python -c "import nltk; nltk.download('vader_lexicon', quiet=True)" 2>/dev/null || true
echo "Build completed successfully!"