File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1919 - name : Set environment variables
2020 run : |
2121 echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV
22+
23+ # Detect if running on GitHub Actions (not Gitea or act)
24+ if [[ "${{ github.server_url }}" == "https://github.com" ]] && [[ -z "${{ env.ACT }}" ]]; then
25+ echo "Running on GitHub - using CPU-only PyTorch"
26+ echo "PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cpu" >> $GITHUB_ENV
27+ echo "TORCH_CPU_ONLY=true" >> $GITHUB_ENV
28+ fi
29+
2230 if [[ "${{ vars.IS_GITEA }}" == "true" ]]; then
2331 echo "Setting thread limits for Gitea runner"
2432 echo "OMP_NUM_THREADS=1" >> $GITHUB_ENV
95103 run : |
96104 cd $GITHUB_WORKSPACE
97105 chmod +x install.sh
98- # This 'pip' command will now inherit the job-level 'REQUESTS_CA_BUNDLE'
106+ # The install.sh will use PIP_EXTRA_INDEX_URL if set for CPU-only PyTorch
99107 ./install.sh
100108
101109 - name : Debug virtual environment
@@ -105,6 +113,9 @@ jobs:
105113 source "$VENV_PATH/bin/activate"
106114 which python
107115 python --version
116+
117+ # Verify PyTorch installation type
118+ python -c "import torch; print(f'PyTorch version: {torch.__version__}'); print(f'CUDA available: {torch.cuda.is_available()}')"
108119
109120 - name : Run tests
110121 run : |
You can’t perform that action at this time.
0 commit comments