Skip to content

Commit

Permalink
conditional installl based on os
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnv1 committed Apr 14, 2024
1 parent a16d503 commit 8a62ca0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/actions/env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ inputs:
required: False
type: strig

env:
WHELL_DEVICE: '+cpu'

runs:
using: "composite"
steps:
Expand Down Expand Up @@ -58,7 +55,13 @@ runs:
- if: ${{ contains(fromJson('["nightly"]'), inputs.pytorch-version ) == false}}
name: Install pytorch
shell: bash
run: uv pip install --system torch==${{ inputs.pytorch-version }}${{ env.WHELL_DEVICE }} ${{ inputs.extra-deps }} --extra-index-url https://download.pytorch.org/whl/cpu
run: |
if [ "$RUNNER_OS" == "Linux" ] || [ "$RUNNER_OS" == "Windows" ]; then
uv pip install --system torch==${{ inputs.pytorch-version }}+cpu ${{ inputs.extra-deps }} --extra-index-url https://download.pytorch.org/whl/cpu
else
uv pip install --system torch==${{ inputs.pytorch-version }} ${{ inputs.extra-deps }} --extra-index-url https://download.pytorch.org/whl/cpu
fi
shell: bash

- if: ${{ contains(fromJson('["1.9.1"]'), inputs.pytorch-version) }}
name: Install accelerate for old torchs
Expand Down

0 comments on commit 8a62ca0

Please sign in to comment.