Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try 1.6 #1

Open
wants to merge 166 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
f94a52c
[s2s] add BartTranslationDistiller for distilling mBART (#6363)
sshleifer Aug 12, 2020
fd3de20
Get GKE logs via kubectl logs instead of gcloud logging read. (#6446)
zcain117 Aug 12, 2020
0735def
[EncoderDecoder] Add encoder-decoder for roberta/ vanilla longformer …
patrickvonplaten Aug 12, 2020
bc82047
add targets arg to fill-mask pipeline (#6239)
joeddav Aug 12, 2020
e983da0
cleanup tf unittests: part 2 (#6260)
stas00 Aug 13, 2020
0ed7c00
Update README.md (#6435)
cedspam Aug 13, 2020
9d94aec
Fix docs and bad word tokens generation_utils.py (#6387)
ZhuBaohe Aug 13, 2020
54c687e
typo fix (#6462)
prajjwal1 Aug 13, 2020
f7cbc13
Test model outputs equivalence (#6445)
LysandreJik Aug 13, 2020
a442f87
add LongformerTokenizerFast in AutoTokenizer (#6463)
patil-suraj Aug 13, 2020
f51161e
add BartTokenizerFast in AutoTokenizer (#6464)
patil-suraj Aug 13, 2020
eda07ef
Add POS tagging and Phrase chunking token classification examples (#6…
vblagoje Aug 13, 2020
e92efcf
Mult rouge by 100: standard units (#6359)
sshleifer Aug 13, 2020
7bc0056
Clean directory after script testing (#6453)
JetRunner Aug 13, 2020
05810cd
Fix typo (#6469)
mrm8488 Aug 13, 2020
680f133
MBartForConditionalGeneration (#6441)
patil-suraj Aug 14, 2020
eb613b5
Use hash to clean the test dirs (#6475)
JetRunner Aug 14, 2020
1d6e71e
[EncoderDecoder] Add Cross Attention for GPT2 (#6415)
patrickvonplaten Aug 14, 2020
9a8c168
Sort unique_no_split_tokens to make it deterministic (#6461)
lhoestq Aug 14, 2020
b5ba758
Import accuracy_score (#6480)
gijswijnholds Aug 14, 2020
895ed8f
Generation doc (#6470)
sgugger Aug 14, 2020
24107c2
Fix TPU Convergence bug introduced by PR#6151 (#6488)
jysohn23 Aug 14, 2020
fe61c05
Add examples/bert-loses-patience who can help (#6499)
JetRunner Aug 16, 2020
2060181
Fixes paths with spaces in seq2seq example (#6493)
KylePiira Aug 16, 2020
72add6c
[s2s] docs, document desired filenames nicely (#6525)
sshleifer Aug 17, 2020
84c265f
[lightning_base] fix s2s logging, only make train_loader once (#6404)
sshleifer Aug 17, 2020
6d38ab1
Update bert-base-portuguese-cased and bert-large-portuguese-cased mod…
fabiocapsouza Aug 17, 2020
df15c7c
typos (#6505)
stas00 Aug 17, 2020
3c72f55
Add Model Card for electra-base-german-uncased (#6496)
PhilipMay Aug 17, 2020
423eb5b
[doc] fix invalid env vars (#6504)
stas00 Aug 17, 2020
48c6c61
Support additional dictionaries for BERT Japanese tokenizers (#6515)
singletongue Aug 17, 2020
72911c8
Create model cards for indonesian models (#6522)
cahya-wirawan Aug 17, 2020
49d8076
[doc] Summary of the models fixes (#6511)
stas00 Aug 17, 2020
37709b5
Remove deprecated assertEquals (#6532)
JetRunner Aug 17, 2020
36010cb
fix pegasus doc (#6533)
patrickvonplaten Aug 17, 2020
9dbe409
[testing] a new TestCasePlus subclass + get_auto_remove_tmp_dir() (#…
stas00 Aug 17, 2020
39c3b1d
[sched] polynomial_decay_schedule use default power=1.0 (#6473)
stas00 Aug 17, 2020
b41cc0b
Fix flaky ONNX tests (#6531)
mfuntowicz Aug 17, 2020
d2da2cb
allow spaces in bash args with "$@" (#6521)
sshleifer Aug 17, 2020
d0c2389
add custom datasets tutorial (#6466)
joeddav Aug 17, 2020
84d3331
[doc] make the text more readable, fix some typos, add some disambigu…
stas00 Aug 17, 2020
2a77813
[BartTokenizer] add prepare s2s batch (#6212)
patil-suraj Aug 17, 2020
b732e7e
[doc] multiple corrections to "Summary of the tasks" (#6509)
stas00 Aug 17, 2020
7ca6ab6
Fix CI
sgugger Aug 17, 2020
f68c873
replace _ with __ rst links (#6541)
stas00 Aug 17, 2020
c9564f5
[Doc] add more MBart and other doc (#6490)
patil-suraj Aug 17, 2020
407da12
[T5Tokenizer] add prepare_seq2seq_batch method (#6122)
patil-suraj Aug 17, 2020
07971d8
[model_cards] Fix yaml for cedpsam/chatbot_fr
julien-c Aug 17, 2020
3a30290
[model_cards] Add a new model for Irish (#6544)
jimregan Aug 17, 2020
98ee802
[model_cards] Add model cards for Urduhack model (roberta-urdu-small)…
akkefa Aug 17, 2020
6314470
Added first model card (#6530)
onepointconsulting Aug 17, 2020
fb7330b
update with #s of sentences/tokens (#6546)
jimregan Aug 17, 2020
12d7624
[marian] converter supports models from new Tatoeba project (#6342)
sshleifer Aug 18, 2020
5a81195
Fixed label datatype for STS-B (#6492)
amodaresi Aug 18, 2020
1fdf372
Small typo fixes for model card: electra-base-german-uncased (#6555)
PhilipMay Aug 18, 2020
cfa26d2
github: add @stefan-it to bug-report template for all token-classific…
stefan-it Aug 18, 2020
7659a8e
fix incorrect codecov reports (#6553)
stas00 Aug 18, 2020
5a5af22
[docs] Fix wrong newline in the middle of a paragraph (#6573)
romainr Aug 18, 2020
7516bcf
[docs] Fix number of 'ug' occurrences in tokenizer_summary (#6574)
romainr Aug 18, 2020
1dfce0f
Create README.md (#6557)
mrm8488 Aug 18, 2020
aaab9ab
Create README.md (#6556)
mrm8488 Aug 18, 2020
fb6844a
[Pegasus Doc] minor typo (#6579)
patil-suraj Aug 18, 2020
6f972e1
update xnli-mt url (#6580)
patil-suraj Aug 18, 2020
974bb4a
[Model card] Bert2GPT2 EncoderDecoder model (#6569)
patrickvonplaten Aug 18, 2020
1529bf9
add BartConfig.force_bos_token_to_be_generated (#6526)
sshleifer Aug 18, 2020
ab42d74
Fix bart base test (#6587)
sshleifer Aug 19, 2020
fe0b85e
[EncoderDecoder] Add functionality to tie encoder decoder weights (#6…
patrickvonplaten Aug 19, 2020
2a7402c
Feed forward chunking others (#6365)
Pradhy729 Aug 19, 2020
9a86321
tf generation utils: remove unused kwargs (#6591)
sshleifer Aug 19, 2020
8bcceac
fix model outputs test (#6593)
patrickvonplaten Aug 19, 2020
7581884
[BartTokenizerFast] add prepare_seq2seq_batch (#6543)
patil-suraj Aug 19, 2020
18ca0e9
Fix #6575 (#6596)
sgugger Aug 19, 2020
93c5c9a
[cleanup] remove confusing newline (#6603)
orena1 Aug 20, 2020
3c3c46f
Typo fix in 04-onnx-export (#6595)
SidJain1412 Aug 20, 2020
61b5ee1
lighter 'make test' (#6512)
stas00 Aug 20, 2020
cabfdfa
Docs copy button misses ... prefixed code (#6518)
romainr Aug 20, 2020
33bf426
removed redundant arg in prepare_inputs (#6614)
prajjwal1 Aug 20, 2020
b3e5469
Fix CI
sgugger Aug 20, 2020
039d8d6
add intro to nlp lib & dataset links to custom datasets tutorial (#6583)
joeddav Aug 20, 2020
573bdb0
Add tests to Trainer (#6605)
sgugger Aug 20, 2020
f9d280a
TFTrainer dataset doc & fix evaluation bug (#6618)
joeddav Aug 20, 2020
c945450
Add tests for Reformer tokenizer (#6485)
D-Roberts Aug 20, 2020
505f2d7
[Tests] fix attention masks in Tests (#6621)
patrickvonplaten Aug 20, 2020
9539583
XLNet Bug when training with apex 16-bit precision (#6567)
johndolgov Aug 20, 2020
e8af90c
Move threshold up for flaky test with Electra (#6622)
sgugger Aug 20, 2020
86c07e6
One last threshold to raise
sgugger Aug 20, 2020
5bf4465
Regression test for pegasus bugfix (#6606)
sshleifer Aug 20, 2020
e5f4522
Trainer automatically drops unused columns in nlp datasets (#6449)
sgugger Aug 20, 2020
b105f2c
Update ONNX doc to match the removal of --optimize argument.
mfuntowicz Aug 21, 2020
efc7460
model card for Spanish electra base (#6633)
mrm8488 Aug 21, 2020
bdf7e5d
Remove accidental comment (#6629)
josephrocca Aug 21, 2020
d0e42a7
CamembertForCausalLM (#6577)
patil-suraj Aug 21, 2020
a4db4e3
[Docs model summaries] Add pegasus to docs (#6640)
patrickvonplaten Aug 21, 2020
9e8c494
Add T5-11B disclaimer
patrickvonplaten Aug 21, 2020
cbda729
[Doc model summary] add MBart model summary (#6649)
patil-suraj Aug 21, 2020
0f94151
Add model card for electricidad-base-generator (#6650)
mrm8488 Aug 21, 2020
97bb249
Correct bug in bert2bert-cnn_dailymail
patrickvonplaten Aug 22, 2020
068df74
added model_card for model codeswitch-hineng-lid-lince and codeswitch…
sagorbrur Aug 22, 2020
f235ee2
Add Roberta2Roberta model card
patrickvonplaten Aug 23, 2020
f230a64
new paper bibtex (#6656)
sshleifer Aug 23, 2020
16e3894
Add Roberta2Roberta shared
patrickvonplaten Aug 23, 2020
a622705
added multiple model_cards for below models (#6666)
sagorbrur Aug 24, 2020
1a779ad
Specify config filename (#6626)
jarednielsen Aug 24, 2020
b30879f
Don't reset the dataset type + plug for rm unused columns (#6683)
sgugger Aug 24, 2020
0a850d2
Missing commit
sgugger Aug 24, 2020
d329c9b
Fixed DataCollatorForLanguageModeling not accepting lists of lists (#…
TevenLeScao Aug 24, 2020
a573777
Update repo to isort v5 (#6686)
sgugger Aug 24, 2020
dd522da
Fix PL token classification examples (#6682)
vblagoje Aug 24, 2020
3a7fdd3
Add hyperparameter search to Trainer (#6576)
sgugger Aug 24, 2020
8f98faf
Lat fix for Ray HP search (#6691)
sgugger Aug 24, 2020
a8d6716
Create PULL_REQUEST_TEMPLATE.md (#6660)
stas00 Aug 24, 2020
912a21e
remove BartForConditionalGeneration.generate (#6659)
stas00 Aug 24, 2020
6b4c617
Move unused args to kwargs (#6694)
sgugger Aug 24, 2020
0ebc969
[fixdoc] Add import to pegasus usage doc (#6698)
sshleifer Aug 24, 2020
d20cbb8
Fix hyperparameter_search doc (#6695)
sgugger Aug 25, 2020
b6512d2
Add model card for singbert. (#6674)
zyuanlim Aug 25, 2020
0344428
[s2s] round bleu, rouge to 4 digits (#6704)
sshleifer Aug 25, 2020
4fca874
Remove hard-coded uses of float32 to fix mixed precision use (#6648)
schmidek Aug 25, 2020
0f16dd0
Add DPR to models summary (#6690)
lhoestq Aug 25, 2020
841f071
Add typing.overload for convert_ids_tokens (#6637)
tamuhey Aug 25, 2020
4db2fa7
Allow tests in examples to use cuda or fp16,if they are available (#5…
Joel-hanson Aug 25, 2020
a99d09c
add new line to make examples run (#6706)
sshleifer Aug 25, 2020
f5bad03
Use generators tqdm progressbars (#6696)
sgugger Aug 25, 2020
abc0202
More tests to Trainer (#6699)
sgugger Aug 25, 2020
124c3d6
Add tokenizer to Trainer (#6689)
sgugger Aug 25, 2020
625318f
tensor.nonzero() is deprecated in PyTorch 1.6 (#6715)
mfuntowicz Aug 25, 2020
a25c9fc
Selected typo fix (#6687)
arnavsharma93 Aug 25, 2020
d17cce2
add missing keys (#6719)
patrickvonplaten Aug 25, 2020
0743403
Create README.md (#6721)
zyuanlim Aug 25, 2020
ac9702c
Fix ONNX test_quantize unittest (#6716)
mfuntowicz Aug 25, 2020
7e6397a
[squad] make examples and dataset accessible from SquadDataset object…
Aug 25, 2020
e11d923
Fix pegasus-xsum integration test (#6726)
sshleifer Aug 25, 2020
6244957
T5Tokenizer adds EOS token if not already added (#5866)
sshleifer Aug 25, 2020
64c7c2b
Install nlp for github actions test (#6728)
sgugger Aug 25, 2020
fa8ee8e
fix torchscript docs (#6740)
patrickvonplaten Aug 26, 2020
925f34b
Add "tie_word_embeddings" config param (#6692)
patrickvonplaten Aug 26, 2020
461ae86
Fix tf boolean mask in graph mode (#6741)
JayYip Aug 26, 2020
77abd1e
Centralize logging (#6434)
LysandreJik Aug 26, 2020
02e8cd5
Fix optimizer (#6717)
jplu Aug 26, 2020
e78c110
isort 5
LysandreJik Aug 26, 2020
a75c64d
Black 20 release
LysandreJik Aug 26, 2020
858b7d5
[TF Longformer] Improve Speed for TF Longformer (#6447)
patrickvonplaten Aug 26, 2020
99407f9
add xlm-roberta-large-xnli model card (#6723)
joeddav Aug 26, 2020
3242e4d
[model_cards] Fix tiny typos
julien-c Aug 26, 2020
baeba53
Adding model cards for 5 models (#6703)
AMontgomerie Aug 26, 2020
e10fb9c
Create model card for lordtt13/COVID-SciBERT (#6718)
lordtt13 Aug 26, 2020
cc4ba79
added model card for codeswitch-spaeng-sentiment-analysis-lince (#6727)
sagorbrur Aug 26, 2020
70c96a1
Model card for kuisailab/albert-base-arabic (#6729)
alisafaya Aug 26, 2020
8e0d51e
Model card for kuisailab/albert-xlarge-arabic (#6731)
alisafaya Aug 26, 2020
61b9ed8
Model card for kuisailab/albert-large-arabic (#6730)
alisafaya Aug 26, 2020
10a3450
add __init__.py to utils (#6754)
joeddav Aug 26, 2020
434936f
Model Card for Multilingual Passage Reranking BERT (#6755)
iglimanaj Aug 26, 2020
61518e2
[s2s] run_eval.py QOL improvements and cleanup(#6746)
sshleifer Aug 26, 2020
05e7150
create ProtBert-BFD model card. (#6724)
agemagician Aug 27, 2020
4bd7be9
s2s distillation uses AutoModelForSeqToSeqLM (#6761)
sshleifer Aug 27, 2020
971d180
Add AdaFactor optimizer from fairseq (#6722)
moscow25 Aug 27, 2020
41aa2b4
Adafactor docs (#6765)
LysandreJik Aug 27, 2020
6f289dc
Fix the TF Trainer gradient accumulation and the TF NER example (#6713)
jplu Aug 27, 2020
0d2c111
Format
LysandreJik Aug 27, 2020
c225e87
Fix it to work with BART (#6756)
tomgrek Aug 27, 2020
9d1b4db
add nlp install (#6767)
sshleifer Aug 27, 2020
e6b811f
[testing] replace hardcoded paths to allow running tests from anywher…
stas00 Aug 27, 2020
dbfe34f
[test schedulers] adjust to test the first step's reading (#6429)
stas00 Aug 27, 2020
70fccc5
new Makefile target: docs (#6510)
stas00 Aug 27, 2020
42fddac
Format
LysandreJik Aug 27, 2020
fd8b1b3
try running existing circleci
zcain117 Aug 27, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
43 changes: 17 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ references:
# non-zero status code.
while [ $i -lt $max_checks ]; do ((i++)); if kubectl get jobs $job_name -o jsonpath='Failed:{.status.failed}' | grep "Failed:1"; then status_code=1 && break; elif kubectl get jobs $job_name -o jsonpath='Succeeded:{.status.succeeded}' | grep "Succeeded:1" ; then status_code=0 && break; else echo "Job not finished yet"; fi; sleep 30; done && \
echo "Done waiting. Job status code: $status_code" && \
# Allow time for logs to flush.
sleep 60 && \
echo "JOB_NAME: $job_name" && \
gcloud logging read "resource.type=k8s_container resource.labels.project_id=$GOOGLE_PROJECT_ID resource.labels.location=$GOOGLE_COMPUTE_ZONE resource.labels.cluster_name=$GKE_CLUSTER resource.labels.namespace_name=default resource.labels.pod_name:$job_name" --limit 10000000 --order asc --format 'value(textPayload)' --project=$GOOGLE_PROJECT_ID && \
pod_name=$(kubectl get po -l controller-uid=`kubectl get job $job_name -o "jsonpath={.metadata.labels.controller-uid}"` | awk 'match($0,!/NAME/) {print $1}') && \
echo "GKE pod name: $pod_name" && \
kubectl logs -f $pod_name --container=train
echo "Done with log retrieval attempt." && \
gcloud container images delete "$GCR_IMAGE_PATH:$CIRCLE_WORKFLOW_JOB_ID" --force-delete-tags && \
exit $status_code
Expand Down Expand Up @@ -78,6 +77,7 @@ jobs:
- v0.3-torch_and_tf-{{ checksum "setup.py" }}
- v0.3-{{ checksum "setup.py" }}
- run: pip install --upgrade pip
- run: pip install git+https://github.com/huggingface/nlp
- run: pip install .[sklearn,tf-cpu,torch,testing]
- run: pip install codecov pytest-cov
- save_cache:
Expand All @@ -104,6 +104,7 @@ jobs:
- v0.3-torch-{{ checksum "setup.py" }}
- v0.3-{{ checksum "setup.py" }}
- run: pip install --upgrade pip
- run: pip install git+https://github.com/huggingface/nlp
- run: pip install .[sklearn,torch,testing]
- save_cache:
key: v0.3-torch-{{ checksum "setup.py" }}
Expand All @@ -128,6 +129,7 @@ jobs:
- v0.3-tf-{{ checksum "setup.py" }}
- v0.3-{{ checksum "setup.py" }}
- run: pip install --upgrade pip
- run: pip install git+https://github.com/huggingface/nlp
- run: pip install .[sklearn,tf-cpu,testing]
- save_cache:
key: v0.3-tf-{{ checksum "setup.py" }}
Expand All @@ -151,6 +153,7 @@ jobs:
- v0.3-{{ checksum "setup.py" }}
- run: pip install --upgrade pip
- run: pip install .[ja,testing]
- run: python -m unidic download
- save_cache:
key: v0.3-custom_tokenizers-{{ checksum "setup.py" }}
paths:
Expand Down Expand Up @@ -235,8 +238,7 @@ jobs:
- v0.3-code_quality-{{ checksum "setup.py" }}
- v0.3-{{ checksum "setup.py" }}
- run: pip install --upgrade pip
# we need a version of isort with https://github.com/timothycrosley/isort/pull/1000
- run: pip install git+git://github.com/timothycrosley/isort.git@e63ae06ec7d70b06df9e528357650281a3d3ec22#egg=isort
- run: pip install isort
- run: pip install .[tf,torch,quality]
- save_cache:
key: v0.3-code_quality-{{ checksum "setup.py" }}
Expand Down Expand Up @@ -294,24 +296,13 @@ workflows:
version: 2
build_and_test:
jobs:
- check_code_quality
- check_repository_consistency
- run_examples_torch
- run_tests_custom_tokenizers
- run_tests_torch_and_tf
- run_tests_torch
- run_tests_tf
- build_doc
- deploy_doc: *workflow_filters
tpu_testing_jobs:
triggers:
- schedule:
# Set to run at the first minute of every hour.
cron: "0 8 * * *"
filters:
branches:
only:
- master
jobs:
- cleanup-gke-jobs
#- check_code_quality
#- check_repository_consistency
#- run_examples_torch
#- run_tests_custom_tokenizers
#- run_tests_torch_and_tf
#- run_tests_torch
#- run_tests_tf
- run_examples_tpu
#- build_doc
#- deploy_doc: *workflow_filters
6 changes: 4 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ assignees: ''
Longformer/Reformer: @patrickvonplaten
TransfoXL/XLNet: @TevenLeScao
examples/seq2seq: @sshleifer
tensorflow: @jplu
documentation: @sgugger
examples/bert-loses-patience: @JetRunner
tensorflow: @jplu
examples/token-classification: @stefan-it
documentation: @sgugger
-->

## Information
Expand Down
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!-- This line specifies which issue to close after the pull request is merged. -->
Fixes #{issue number}
3 changes: 2 additions & 1 deletion .github/workflows/self-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ jobs:
source .env/bin/activate
pip install --upgrade pip
pip install torch!=1.6.0
pip install .[sklearn,testing]
pip install .[sklearn,testing,onnxruntime]
pip install git+https://github.com/huggingface/nlp

- name: Are GPUs recognized by our DL frameworks
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/self-scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ jobs:
source .env/bin/activate
pip install --upgrade pip
pip install torch!=1.6.0
pip install .[sklearn,testing]
pip install .[sklearn,testing,onnxruntime]
pip install git+https://github.com/huggingface/nlp

- name: Are GPUs recognized by our DL frameworks
run: |
Expand All @@ -58,6 +59,7 @@ jobs:
run: |
source .env/bin/activate
python -m pytest -n 1 --dist=loadfile -s ./tests/

- name: Run examples tests on GPU
env:
TF_FORCE_GPU_ALLOW_GROWTH: "true"
Expand Down
46 changes: 29 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Awesome! Please provide the following information:
If you are willing to contribute the model yourself, let us know so we can best
guide you.

We have added a **detailed guide and templates** to guide you in the process of adding a new model. You can find them
We have added a **detailed guide and templates** to guide you in the process of adding a new model. You can find them
in the [`templates`](https://github.com/huggingface/transformers/tree/master/templates) folder.

### Do you want a new feature (that is not a model)?
Expand All @@ -87,8 +87,8 @@ A world-class feature request addresses the following points:
If your issue is well written we're already 80% of the way there by the time you
post it.

We have added **templates** to guide you in the process of adding a new example script for training or testing the
models in the library. You can find them in the [`templates`](https://github.com/huggingface/transformers/tree/master/templates)
We have added **templates** to guide you in the process of adding a new example script for training or testing the
models in the library. You can find them in the [`templates`](https://github.com/huggingface/transformers/tree/master/templates)
folder.

## Start contributing! (Pull Requests)
Expand Down Expand Up @@ -134,12 +134,6 @@ Follow these steps to start contributing:
it with `pip uninstall transformers` before reinstalling it in editable
mode with the `-e` flag.)

Right now, we need an unreleased version of `isort` to avoid a
[bug](https://github.com/timothycrosley/isort/pull/1000):

```bash
$ pip install -U git+git://github.com/timothycrosley/isort.git@e63ae06ec7d70b06df9e528357650281a3d3ec22#egg=isort
```
5. Develop the features on your branch.

As you work on the features, you should make sure that the test suite
Expand All @@ -149,6 +143,14 @@ Follow these steps to start contributing:
$ make test
```

Note, that this command uses `-n auto` pytest flag, therefore, it will start as many parallel `pytest` processes as the number of your computer's CPU-cores, and if you have lots of those and a few GPUs and not a great amount of RAM, it's likely to overload your computer. Therefore, to run the test suite, you may want to consider using this command instead:

```bash
$ python -m pytest -n 3 --dist=loadfile -s -v ./tests/
```

Adjust the value of `-n` to fit the load your hardware can support.

`transformers` relies on `black` and `isort` to format its source code
consistently. After you make changes, format them with:

Expand All @@ -163,6 +165,16 @@ Follow these steps to start contributing:
$ make quality
```

If you're modifying documents under `docs/source`, make sure to validate that
they can still be built. This check also runs in CI. To run a local check
make sure you have installed the documentation builder requirements, by
running `pip install .[tf,torch,docs]` once from the root of this repository
and then run:

```bash
$ make docs
```

Once you're happy with your changes, add changed files using `git add` and
make a commit with `git commit` to record your changes locally:

Expand Down Expand Up @@ -208,21 +220,21 @@ Follow these steps to start contributing:
are useful to avoid duplicated work, and to differentiate it from PRs ready
to be merged;
4. Make sure existing tests pass;
5. Add high-coverage tests. No quality testing = no merge.
- If you are adding a new model, make sure that you use
5. Add high-coverage tests. No quality testing = no merge.
- If you are adding a new model, make sure that you use
`ModelTester.all_model_classes = (MyModel, MyModelWithLMHead,...)`, which triggers the common tests.
- If you are adding new `@slow` tests, make sure they pass using
`RUN_SLOW=1 python -m pytest tests/test_my_new_model.py`.
- If you are adding a new tokenizer, write tests, and make sure
- If you are adding new `@slow` tests, make sure they pass using
`RUN_SLOW=1 python -m pytest tests/test_my_new_model.py`.
- If you are adding a new tokenizer, write tests, and make sure
`RUN_SLOW=1 python -m pytest tests/test_tokenization_{your_model_name}.py` passes.
CircleCI does not run the slow tests, but github actions does every night!
6. All public methods must have informative docstrings that work nicely with sphinx. See `modeling_ctrl.py` for an
6. All public methods must have informative docstrings that work nicely with sphinx. See `modeling_ctrl.py` for an
example.

### Tests

An extensive test suite is included to test the library behavior and several examples. Library tests can be found in
the [tests folder](https://github.com/huggingface/transformers/tree/master/tests) and examples tests in the
An extensive test suite is included to test the library behavior and several examples. Library tests can be found in
the [tests folder](https://github.com/huggingface/transformers/tree/master/tests) and examples tests in the
[examples folder](https://github.com/huggingface/transformers/tree/master/examples).

We like `pytest` and `pytest-xdist` because it's faster. From the root of the
Expand Down
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
.PHONY: quality style test test-examples
.PHONY: quality style test test-examples docs

# Check that source code meets quality standards

quality:
black --check --line-length 119 --target-version py35 examples templates tests src utils
isort --check-only --recursive examples templates tests src utils
isort --check-only examples templates tests src utils
flake8 examples templates tests src utils
python utils/check_repo.py

# Format source code automatically

style:
black --line-length 119 --target-version py35 examples templates tests src utils
isort --recursive examples templates tests src utils
isort examples templates tests src utils

# Run tests for the library

Expand All @@ -23,3 +23,8 @@ test:

test-examples:
python -m pytest -n auto --dist=loadfile -s -v ./examples/

# Check that docs can build

docs:
cd docs && make html SPHINXOPTS="-W"
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,13 @@ At some point in the future, you'll be able to seamlessly move from pre-training
19. **[Reformer](https://huggingface.co/transformers/model_doc/reformer.html)** (from Google Research) released with the paper [Reformer: The Efficient Transformer](https://arxiv.org/abs/2001.04451) by Nikita Kitaev, Łukasz Kaiser, Anselm Levskaya.
20. **[MarianMT](https://huggingface.co/transformers/model_doc/marian.html)** Machine translation models trained using [OPUS](http://opus.nlpl.eu/) data by Jörg Tiedemann. The [Marian Framework](https://marian-nmt.github.io/) is being developed by the Microsoft Translator Team.
21. **[Longformer](https://huggingface.co/transformers/model_doc/longformer.html)** (from AllenAI) released with the paper [Longformer: The Long-Document Transformer](https://arxiv.org/abs/2004.05150) by Iz Beltagy, Matthew E. Peters, Arman Cohan.
22. **[Other community models](https://huggingface.co/models)**, contributed by the [community](https://huggingface.co/users).
23. Want to contribute a new model? We have added a **detailed guide and templates** to guide you in the process of adding a new model. You can find them in the [`templates`](./templates) folder of the repository. Be sure to check the [contributing guidelines](./CONTRIBUTING.md) and contact the maintainers or open an issue to collect feedbacks before starting your PR.
22. **[DPR](https://github.com/facebookresearch/DPR)** (from Facebook) released with the paper [Dense Passage Retrieval
for Open-Domain Question Answering](https://arxiv.org/abs/2004.04906) by Vladimir Karpukhin, Barlas Oğuz, Sewon
Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih.
23. **[Pegasus](https://github.com/google-research/pegasus)** (from Google) released with the paper [PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive Summarization](https://arxiv.org/abs/1912.08777)> by Jingqing Zhang, Yao Zhao, Mohammad Saleh and Peter J. Liu.
24. **[MBart](https://github.com/pytorch/fairseq/tree/master/examples/mbart)** (from Facebook) released with the paper [Multilingual Denoising Pre-training for Neural Machine Translation](https://arxiv.org/abs/2001.08210) by Yinhan Liu, Jiatao Gu, Naman Goyal, Xian Li, Sergey Edunov, Marjan Ghazvininejad, Mike Lewis, Luke Zettlemoyer.
25. **[Other community models](https://huggingface.co/models)**, contributed by the [community](https://huggingface.co/users).
26. Want to contribute a new model? We have added a **detailed guide and templates** to guide you in the process of adding a new model. You can find them in the [`templates`](./templates) folder of the repository. Be sure to check the [contributing guidelines](./CONTRIBUTING.md) and contact the maintainers or open an issue to collect feedbacks before starting your PR.

These implementations have been tested on several datasets (see the example scripts) and should match the performances of the original implementations (e.g. ~93 F1 on SQuAD for BERT Whole-Word-Masking, ~88 F1 on RocStories for OpenAI GPT, ~18.3 perplexity on WikiText 103 for Transformer-XL, ~0.916 Pearson R coefficient on STS-B for XLNet). You can find more details on the performances in the Examples section of the [documentation](https://huggingface.co/transformers/examples.html).

Expand Down Expand Up @@ -620,7 +625,7 @@ Breaking change in the `from_pretrained()` method:

1. Models are now set in evaluation mode by default when instantiated with the `from_pretrained()` method. To train them, don't forget to set them back in training mode (`model.train()`) to activate the dropout modules.

2. The additional `*input` and `**kwargs` arguments supplied to the `from_pretrained()` method used to be directly passed to the underlying model's class `__init__()` method. They are now used to update the model configuration attribute instead, which can break derived model classes built based on the previous `BertForSequenceClassification` examples. We are working on a way to mitigate this breaking change in [#866](https://github.com/huggingface/transformers/pull/866) by forwarding the the model's `__init__()` method (i) the provided positional arguments and (ii) the keyword arguments which do not match any configuration class attributes.
2. The additional `*input` and `**kwargs` arguments supplied to the `from_pretrained()` method used to be directly passed to the underlying model's class `__init__()` method. They are now used to update the model configuration attribute instead, which can break derived model classes built based on the previous `BertForSequenceClassification` examples. We are working on a way to mitigate this breaking change in [#866](https://github.com/huggingface/transformers/pull/866) by forwarding the model's `__init__()` method (i) the provided positional arguments and (ii) the keyword arguments which do not match any configuration class attributes.

Also, while not a breaking change, the serialization methods have been standardized and you probably should switch to the new method `save_pretrained(save_directory)` if you were using any other serialization method before.

Expand Down Expand Up @@ -693,11 +698,11 @@ for batch in train_data:

## Citation

We now have a paper you can cite for the 🤗 Transformers library:
We now have a [paper](https://arxiv.org/abs/1910.03771) you can cite for the 🤗 Transformers library:
```bibtex
@article{Wolf2019HuggingFacesTS,
title={HuggingFace's Transformers: State-of-the-art Natural Language Processing},
author={Thomas Wolf and Lysandre Debut and Victor Sanh and Julien Chaumond and Clement Delangue and Anthony Moi and Pierric Cistac and Tim Rault and R'emi Louf and Morgan Funtowicz and Jamie Brew},
author={Thomas Wolf and Lysandre Debut and Victor Sanh and Julien Chaumond and Clement Delangue and Anthony Moi and Pierric Cistac and Tim Rault and Rémi Louf and Morgan Funtowicz and Joe Davison and Sam Shleifer and Patrick von Platen and Clara Ma and Yacine Jernite and Julien Plu and Canwen Xu and Teven Le Scao and Sylvain Gugger and Mariama Drame and Quentin Lhoest and Alexander M. Rush},
journal={ArXiv},
year={2019},
volume={abs/1910.03771}
Expand Down
4 changes: 4 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ coverage:
default:
informational: true
patch: off
comment:
require_changes: true # only comment if there was change in coverage
require_head: yes # don't report if there is no head coverage report
require_base: yes # don't report if there is no base coverage report
1 change: 1 addition & 0 deletions docs/source/_static/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const versionMapping = {
// The page that have a notebook and therefore should have the open in colab badge.
const hasNotebook = [
"benchmarks",
"custom_datasets",
"multilingual",
"perplexity",
"preprocessing",
Expand Down
3 changes: 2 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
pygments_style = None

# Remove the prompt when copying examples
copybutton_prompt_text = ">>> "
copybutton_prompt_text = r">>> |\.\.\. "
copybutton_prompt_is_regexp = True

# -- Options for HTML output -------------------------------------------------

Expand Down
Loading