Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into save_fp16_model-fal…
Browse files Browse the repository at this point in the history
…lback
  • Loading branch information
stas00 committed Jan 28, 2022
2 parents 2b19c5b + d25e25e commit 3e749a8
Show file tree
Hide file tree
Showing 864 changed files with 55,007 additions and 20,991 deletions.
24 changes: 12 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
path: ~/transformers/tests_output.txt
- store_artifacts:
path: ~/transformers/reports

run_tests_torch_and_tf_all:
working_directory: ~/transformers
docker:
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
path: ~/transformers/tests_output.txt
- store_artifacts:
path: ~/transformers/reports

run_tests_torch_and_flax_all:
working_directory: ~/transformers
docker:
Expand Down Expand Up @@ -237,7 +237,7 @@ jobs:
path: ~/transformers/tests_output.txt
- store_artifacts:
path: ~/transformers/reports

run_tests_torch_all:
working_directory: ~/transformers
docker:
Expand Down Expand Up @@ -304,7 +304,7 @@ jobs:
path: ~/transformers/tests_output.txt
- store_artifacts:
path: ~/transformers/reports

run_tests_tf_all:
working_directory: ~/transformers
docker:
Expand Down Expand Up @@ -370,7 +370,7 @@ jobs:
path: ~/transformers/tests_output.txt
- store_artifacts:
path: ~/transformers/reports

run_tests_flax_all:
working_directory: ~/transformers
docker:
Expand Down Expand Up @@ -437,7 +437,7 @@ jobs:
path: ~/transformers/tests_output.txt
- store_artifacts:
path: ~/transformers/reports

run_tests_pipelines_torch_all:
working_directory: ~/transformers
docker:
Expand Down Expand Up @@ -549,15 +549,15 @@ jobs:
- v0.4-custom_tokenizers-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run: pip install --upgrade pip
- run: pip install .[ja,testing,sentencepiece,jieba]
- run: pip install .[ja,testing,sentencepiece,jieba,spacy,ftfy]
- run: python -m unidic download
- save_cache:
key: v0.4-custom_tokenizers-{{ checksum "setup.py" }}
paths:
- '~/.cache/pip'
- run: |
if [ -f test_list.txt ]; then
python -m pytest -s --make-reports=tests_custom_tokenizers ./tests/test_tokenization_bert_japanese.py | tee tests_output.txt
python -m pytest -s --make-reports=tests_custom_tokenizers ./tests/test_tokenization_bert_japanese.py ./tests/test_tokenization_openai.py | tee tests_output.txt
fi
- store_artifacts:
path: ~/transformers/tests_output.txt
Expand Down Expand Up @@ -662,7 +662,7 @@ jobs:
path: ~/transformers/flax_examples_output.txt
- store_artifacts:
path: ~/transformers/reports

run_examples_flax_all:
working_directory: ~/transformers
docker:
Expand Down Expand Up @@ -729,7 +729,7 @@ jobs:
path: ~/transformers/tests_output.txt
- store_artifacts:
path: ~/transformers/reports

run_tests_hub_all:
working_directory: ~/transformers
docker:
Expand Down Expand Up @@ -795,7 +795,7 @@ jobs:
path: ~/transformers/tests_output.txt
- store_artifacts:
path: ~/transformers/reports

run_tests_onnxruntime_all:
working_directory: ~/transformers
docker:
Expand Down Expand Up @@ -848,7 +848,7 @@ jobs:
- run: isort --check-only examples tests src utils
- run: python utils/custom_init_isort.py --check_only
- run: flake8 examples tests src utils
# - run: python utils/style_doc.py src/transformers docs/source --max_len 119 --check_only
- run: python utils/style_doc.py src/transformers docs/source --max_len 119 --check_only

check_repository_consistency:
working_directory: ~/transformers
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Library:
- Deepspeed: @stas00
- Ray/raytune: @richardliaw, @amogkam
- Text generation: @patrickvonplaten @narsil
- Tokenizers: @LysandreJik
- Tokenizers: @SaulLu
- Trainer: @sgugger
- Pipelines: @Narsil
- Speech: @patrickvonplaten, @anton-l
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/add-model-like.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Add model like runner

on:
push:
branches:
- master
pull_request:
paths:
- "src/**"
- "tests/**"
- ".github/**"
types: [opened, synchronize, reopened]

jobs:
run_tests_templates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Loading cache.
uses: actions/cache@v2
id: cache
with:
path: ~/.cache/pip
key: v1-tests_model_like
restore-keys: |
v1-tests_model_like-${{ hashFiles('setup.py') }}
v1-tests_model_like
- name: Install dependencies
run: |
pip install --upgrade pip!=21.3
sudo apt -y update && sudo apt install -y libsndfile1-dev
pip install .[dev]
- name: Create model files
run: |
transformers-cli add-new-model-like --config_file tests/fixtures/add_distilbert_like_config.json --path_to_repo .
make style
make fix-copies
- name: Run all PyTorch modeling test
run: |
python -m pytest -n 2 --dist=loadfile -s --make-reports=tests_new_models tests/test_modeling_bert_new.py
- name: Run style changes
run: |
make style && make quality && make repo-consistency
- name: Failure short reports
if: ${{ always() }}
run: cat reports/tests_new_models_failures_short.txt

- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: run_all_tests_new_models_test_reports
path: reports
120 changes: 120 additions & 0 deletions .github/workflows/build_dev_documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Build dev documentation

on:
pull_request:


jobs:
build_and_package:
runs-on: [self-hosted, doc-builder]
container:
image: huggingface/doc-builder-transformers
options: "-v /home/github_actions:/mnt"
env:
PR_NUMBER: ${{ github.event.number }}
EVENT_CONTEXT: ${{ toJSON(github.event) }}

steps:
- uses: actions/checkout@v2
with:
repository: 'huggingface/doc-builder'
path: doc-builder

- uses: actions/checkout@v2
with:
repository: 'huggingface/transformers'
path: transformers

- uses: actions/checkout@v2
with:
repository: 'huggingface/notebooks'
path: notebooks

- name: Set env
run: echo "WRITE=$(cat /mnt/WRITE)" >> $GITHUB_ENV

- name: Comment PR
uses: thollander/actions-comment-pull-request@v1
if: github.event.action == 'opened'

with:
message: 'The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_${{ env.PR_NUMBER }}). All of your documentation changes will be reflected on that endpoint.'
GITHUB_TOKEN: ${{ env.WRITE }}

- name: Find Comment
if: github.event.action == 'reopened'
uses: peter-evans/find-comment@v1
id: fc
with:
issue-number: ${{ env.PR_NUMBER }}
comment-author: HuggingFaceDocBuilder

- name: Update comment
if: github.event.action == 'reopened'
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
token: ${{ env.WRITE }}
edit-mode: replace
body: |
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_${{ env.PR_NUMBER }}). All of your documentation changes will be reflected on that endpoint.
- name: Loading cache.
uses: actions/cache@v2
id: cache
with:
path: ~/.cache/pip
key: v1-test_build_doc
restore-keys: |
v1-test_build_doc-${{ hashFiles('setup.py') }}
v1-test_build_doc
- name: Setup environment
run: |
apt-get -y update && apt-get install -y libsndfile1-dev
pip uninstall -y doc-builder
pip install git+https://github.com/huggingface/doc-builder -U
cd transformers
pip install .[dev]
cd ..
export TORCH_VERSION=$(python -c "from torch import version; print(version.__version__.split('+')[0])")
pip install torch-scatter -f https://data.pyg.org/whl/torch-${TORCH_VERSION}+cpu.html
pip install torchvision
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
apt install -y tesseract-ocr
pip install pytesseract
pip install pytorch-quantization --extra-index-url https://pypi.ngc.nvidia.com
pip install https://github.com/kpu/kenlm/archive/master.zip
- name: Setup git
run: |
git config --global user.name "Hugging Face Doc Builder"
git config --global user.email docs@huggingface.co
cd doc-builder
git pull origin main
cd ..
cd notebooks
git pull origin master
cd ..
WRITE=`cat /mnt/WRITE`
rm -rf doc-build-dev
git clone https://HuggingFaceDocBuilder:$WRITE@github.com/huggingface/doc-build-dev
- name: Make documentation
run: |
doc-builder build transformers transformers/docs/source --build_dir doc-build-dev --notebook_dir notebooks/transformers_doc --clean --version pr_$PR_NUMBER
- name: Push to repositories
run: |
cd doc-build-dev
ls
git add .
git commit -m "Updated with commit ${{ github.sha }} See: https://github.com/huggingface/transformers/commit/${{ github.sha }}"
git push origin main
16 changes: 8 additions & 8 deletions .github/workflows/build_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
repository: 'huggingface/doc-builder'
path: doc-builder
repository: 'huggingface/doc-build'
path: doc-build
token: ${{ secrets.HUGGINGFACE_PUSH }}

- uses: actions/checkout@v2
Expand Down Expand Up @@ -64,10 +64,10 @@ jobs:
- name: Setup git
run: |
git config --global user.name "Hugging Face"
git config --global user.email transformers@huggingface.co
git config --global user.name "Hugging Face Doc Builder"
git config --global user.email docs@huggingface.co
cd doc-builder
cd doc-build
git pull origin main
cd ..
Expand All @@ -77,13 +77,13 @@ jobs:
- name: Make documentation
run: |
doc-builder build transformers transformers/docs/source --build_dir doc-builder/build --notebook_dir notebooks/transformers_doc --clean
doc-builder build transformers transformers/docs/source --build_dir doc-build --notebook_dir notebooks/transformers_doc --clean
- name: Push to repositories
run: |
cd doc-builder
cd doc-build
if [[ `git status --porcelain` ]]; then
git add build
git add .
git commit -m "Updated with commit ${{ github.sha }} \n\nSee: https://github.com/huggingface/transformers/commit/${{ github.sha }}"
git push origin main
else
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/delete_dev_documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Delete dev documentation

on:
pull_request:
types: [ closed ]


jobs:
build_and_package:
runs-on: [self-hosted, doc-builder]
container:
image: huggingface/doc-builder-transformers
options: "-v /home/github_actions:/mnt"
env:
PR_NUMBER: ${{ github.event.number }}

steps:
- uses: actions/checkout@v2
- name: Set env
run: echo "WRITE=$(cat /mnt/WRITE)" >> $GITHUB_ENV

- uses: actions/checkout@v2
with:
repository: 'huggingface/doc-build-dev'
path: doc-build-dev
token: ${{ env.WRITE }}

- name: Setup git
run: |
git config --global user.name "Hugging Face Doc Builder"
git config --global user.email docs@huggingface.co
- name: Push to repositories
run: |
cd doc-build-dev
ls
rm -rf transformers/pr_$PR_NUMBER
ls
git add .
git commit -m "Closed PR ${GITHUB_REF##*/}"
git push origin main
- name: Find Comment
if: ${{ always() }}
uses: peter-evans/find-comment@v1
id: fc
with:
issue-number: ${{ env.PR_NUMBER }}
comment-author: HuggingFaceDocBuilder

- name: Update comment
if: ${{ always() }}
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
token: ${{ env.WRITE }}
edit-mode: replace
body: |
_The documentation is not available anymore as the PR was closed or merged._
Loading

0 comments on commit 3e749a8

Please sign in to comment.