Create empty venv on cache miss (#16816)

This commit is contained in:
Joao Gante 2022-04-18 12:49:31 +01:00 committed by GitHub
parent 438144832e
commit 6984848ed0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -29,10 +29,15 @@ jobs:
path: ~/venv/
key: v1-torch_hub-${{ hashFiles('setup.py') }}
- name: Create virtual environment on cache miss
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m venv ~/venv && . ~/venv/bin/activate
pip install --upgrade pip
- name: Install dependencies
run: |
. ~/venv/bin/activate
pip install --upgrade pip
# install torch-hub specific dependencies
pip install -e git+https://github.com/huggingface/transformers.git#egg=transformers[torchhub]
# no longer needed

View File

@ -23,6 +23,12 @@ jobs:
path: ~/venv/
key: v2-metadata-${{ hashFiles('setup.py') }}
- name: Create virtual environment on cache miss
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m venv ~/venv && . ~/venv/bin/activate
pip install --upgrade pip
- name: Setup environment
run: |
. ~/venv/bin/activate