Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
02de7a8e
Unverified
Commit
02de7a8e
authored
Apr 18, 2022
by
Joao Gante
Committed by
GitHub
Apr 18, 2022
Browse files
CI: non-remote GH Actions now use a python venv (#16789)
parent
dee6f016
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
17 deletions
+36
-17
.github/workflows/add-model-like.yml
.github/workflows/add-model-like.yml
+13
-6
.github/workflows/github-torch-hub.yml
.github/workflows/github-torch-hub.yml
+4
-3
.github/workflows/model-templates.yml
.github/workflows/model-templates.yml
+14
-5
.github/workflows/update_metdata.yml
.github/workflows/update_metdata.yml
+5
-3
No files found.
.github/workflows/add-model-like.yml
View file @
02de7a8e
...
@@ -18,32 +18,39 @@ jobs:
...
@@ -18,32 +18,39 @@ jobs:
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
name
:
Loading cache.
-
name
:
Install dependencies
run
:
|
sudo apt -y update && sudo apt install -y libsndfile1-dev
-
name
:
Load cached virtual environment
uses
:
actions/cache@v2
uses
:
actions/cache@v2
id
:
cache
id
:
cache
with
:
with
:
path
:
~/
.cache/pip
path
:
~/
venv/
key
:
v
1
-tests_model_like-${{ hashFiles('setup.py') }}
key
:
v
2
-tests_model_like-${{ hashFiles('setup.py') }}
-
name
:
Install dependencies
-
name
:
Create virtual environment on cache miss
if
:
steps.cache.outputs.cache-hit != 'true'
run
:
|
run
:
|
python -m venv ~/venv && . ~/venv/bin/activate
pip install --upgrade pip!=21.3
pip install --upgrade pip!=21.3
pip install -U click # Click 7 is installed in the environment by default, but we need at least version 8 for Black
sudo apt -y update && sudo apt install -y libsndfile1-dev
pip install .[dev]
pip install .[dev]
-
name
:
Create model files
-
name
:
Create model files
run
:
|
run
:
|
. ~/venv/bin/activate
transformers-cli add-new-model-like --config_file tests/fixtures/add_distilbert_like_config.json --path_to_repo .
transformers-cli add-new-model-like --config_file tests/fixtures/add_distilbert_like_config.json --path_to_repo .
make style
make style
make fix-copies
make fix-copies
-
name
:
Run all PyTorch modeling test
-
name
:
Run all PyTorch modeling test
run
:
|
run
:
|
. ~/venv/bin/activate
python -m pytest -n 2 --dist=loadfile -s --make-reports=tests_new_models tests/bert_new/test_modeling_bert_new.py
python -m pytest -n 2 --dist=loadfile -s --make-reports=tests_new_models tests/bert_new/test_modeling_bert_new.py
-
name
:
Run style changes
-
name
:
Run style changes
run
:
|
run
:
|
. ~/venv/bin/activate
make style && make quality && make repo-consistency
make style && make quality && make repo-consistency
-
name
:
Failure short reports
-
name
:
Failure short reports
...
...
.github/workflows/github-torch-hub.yml
View file @
02de7a8e
...
@@ -22,15 +22,16 @@ jobs:
...
@@ -22,15 +22,16 @@ jobs:
with
:
with
:
python-version
:
3.7
python-version
:
3.7
-
name
:
Load
ing
cache
-
name
:
Load cache
d virtual environment
uses
:
actions/cache@v2
uses
:
actions/cache@v2
id
:
cache
id
:
cache
with
:
with
:
path
:
~/
.cache/pip
path
:
~/
venv/
key
:
v
0
-torch_hub-${{ hashFiles('setup.py') }}
key
:
v
1
-torch_hub-${{ hashFiles('setup.py') }}
-
name
:
Install dependencies
-
name
:
Install dependencies
run
:
|
run
:
|
. ~/venv/bin/activate
pip install --upgrade pip
pip install --upgrade pip
# install torch-hub specific dependencies
# install torch-hub specific dependencies
pip install -e git+https://github.com/huggingface/transformers.git#egg=transformers[torchhub]
pip install -e git+https://github.com/huggingface/transformers.git#egg=transformers[torchhub]
...
...
.github/workflows/model-templates.yml
View file @
02de7a8e
...
@@ -24,20 +24,27 @@ jobs:
...
@@ -24,20 +24,27 @@ jobs:
with
:
with
:
python-version
:
3.6
python-version
:
3.6
-
name
:
Loading cache.
-
name
:
Install dependencies
run
:
|
sudo apt -y update && sudo apt install -y libsndfile1-dev
-
name
:
Load cached virtual environment
uses
:
actions/cache@v2
uses
:
actions/cache@v2
id
:
cache
id
:
cache
with
:
with
:
path
:
~/
.cache/pip
path
:
~/
venv/
key
:
v
1.
2-tests_templates-${{ hashFiles('setup.py') }}
key
:
v2-tests_templates-${{ hashFiles('setup.py') }}
-
name
:
Install dependencies
-
name
:
Create virtual environment on cache miss
if
:
steps.cache.outputs.cache-hit != 'true'
run
:
|
run
:
|
python -m venv ~/venv && . ~/venv/bin/activate
pip install --upgrade pip!=21.3
pip install --upgrade pip!=21.3
sudo apt -y update && sudo apt install -y libsndfile1-dev
pip install .[dev]
pip install .[dev]
-
name
:
Create model files
-
name
:
Create model files
run
:
|
run
:
|
. ~/venv/bin/activate
transformers-cli add-new-model --testing --testing_file=templates/adding_a_new_model/tests/encoder-bert-tokenizer.json --path=templates/adding_a_new_model
transformers-cli add-new-model --testing --testing_file=templates/adding_a_new_model/tests/encoder-bert-tokenizer.json --path=templates/adding_a_new_model
transformers-cli add-new-model --testing --testing_file=templates/adding_a_new_model/tests/pt-encoder-bert-tokenizer.json --path=templates/adding_a_new_model
transformers-cli add-new-model --testing --testing_file=templates/adding_a_new_model/tests/pt-encoder-bert-tokenizer.json --path=templates/adding_a_new_model
transformers-cli add-new-model --testing --testing_file=templates/adding_a_new_model/tests/standalone.json --path=templates/adding_a_new_model
transformers-cli add-new-model --testing --testing_file=templates/adding_a_new_model/tests/standalone.json --path=templates/adding_a_new_model
...
@@ -53,11 +60,13 @@ jobs:
...
@@ -53,11 +60,13 @@ jobs:
-
name
:
Run all non-slow tests
-
name
:
Run all non-slow tests
run
:
|
run
:
|
. ~/venv/bin/activate
python -m pytest -n 2 --dist=loadfile -s --make-reports=tests_templates tests/*template*
python -m pytest -n 2 --dist=loadfile -s --make-reports=tests_templates tests/*template*
-
name
:
Run style changes
-
name
:
Run style changes
run
:
|
run
:
|
git fetch origin main:main
git fetch origin main:main
. ~/venv/bin/activate
make style && make quality && make repo-consistency
make style && make quality && make repo-consistency
-
name
:
Failure short reports
-
name
:
Failure short reports
...
...
.github/workflows/update_metdata.yml
View file @
02de7a8e
...
@@ -16,17 +16,19 @@ jobs:
...
@@ -16,17 +16,19 @@ jobs:
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
name
:
Load
ing
cache
.
-
name
:
Load cache
d virtual environment
uses
:
actions/cache@v2
uses
:
actions/cache@v2
id
:
cache
id
:
cache
with
:
with
:
path
:
~/
.cache/pip
path
:
~/
venv/
key
:
v
1
-metadata-${{ hashFiles('setup.py') }}
key
:
v
2
-metadata-${{ hashFiles('setup.py') }}
-
name
:
Setup environment
-
name
:
Setup environment
run
:
|
run
:
|
. ~/venv/bin/activate
pip install git+https://github.com/huggingface/transformers#egg=transformers[dev]
pip install git+https://github.com/huggingface/transformers#egg=transformers[dev]
-
name
:
Update metadata
-
name
:
Update metadata
run
:
|
run
:
|
. ~/venv/bin/activate
python utils/update_metadata.py --token ${{ secrets.SYLVAIN_HF_TOKEN }} --commit_sha ${{ github.sha }}
python utils/update_metadata.py --token ${{ secrets.SYLVAIN_HF_TOKEN }} --commit_sha ${{ github.sha }}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment