Skip to content

Commit

Permalink
Merge pull request #12 from kornia/extra-deps
Browse files Browse the repository at this point in the history
add extra-deps to env
  • Loading branch information
johnnv1 authored Jan 30, 2024
2 parents 383a0b1 + 3cd3670 commit 08c2ee7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/actions/env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ inputs:
ref:
default: ${{ github.sha }}

extra-deps:
description: "Dependencies to be installed manually before installing kornia."
default: ""
required: False
type: strig

runs:
using: "composite"
steps:
Expand All @@ -32,12 +38,12 @@ runs:
- if: ${{ contains(fromJson('["nightly"]'), inputs.pytorch-version ) }}
name: Install PyTorch nightly
shell: bash
run: pip install numpy --pre torch[dynamo] --force-reinstall --extra-index-url https://download.pytorch.org/whl/nightly/cpu/
run: pip install numpy --pre torch[dynamo] ${{ inputs.extra-deps }} --force-reinstall --extra-index-url https://download.pytorch.org/whl/nightly/cpu/

- if: ${{ contains(fromJson('["nightly"]'), inputs.pytorch-version ) == false}}
name: Install pytorch
shell: bash
run: pip install torch==${{ inputs.pytorch-version }} --index-url https://download.pytorch.org/whl/cpu
run: pip install torch==${{ inputs.pytorch-version }} ${{ inputs.extra-deps }} --index-url https://download.pytorch.org/whl/cpu

- if: ${{ contains(fromJson('["1.9.1"]'), inputs.pytorch-version) }}
name: Install accelerate for old torchs
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Has the inputs:
channel.
- If the value passed is `nightly` the nightly version of pytorch with dynamo
will be installed from pip.
- `extra-deps`: (string, default: `''`) will install alongside the pytorch these dependencies
before install kornia itself.

#### example
```yaml
Expand Down

0 comments on commit 08c2ee7

Please sign in to comment.