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

Sync/v4.17.0 #311

Merged
merged 880 commits into from
Mar 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
880 commits
Select commit Hold shift + click to select a range
87918d3
[examples/Flax] add a section about GPUs (#15198)
patil-suraj Jan 31, 2022
5a70987
Fix TFLEDModel (#15356)
ydshieh Jan 31, 2022
a5ecbf7
correct positionla emb size (#15441)
patil-suraj Jan 31, 2022
6915174
[RobertaTokenizer] remove inheritance on GPT2Tokenizer (#15429)
patil-suraj Jan 31, 2022
09f9d07
Misfiring tf warnings (#15442)
Rocketknight1 Jan 31, 2022
d984b10
Add 'with torch.no_grad()' to BEiT integration test forward passes (#…
itsTurner Jan 31, 2022
125a288
Update modeling_wav2vec2.py (#15423)
peregilk Jan 31, 2022
0c17e76
Error when group_by_length is used with an IterableDataset (#15437)
sgugger Jan 31, 2022
d4f201b
skip test for XGLM (#15445)
patil-suraj Jan 31, 2022
d12ae81
[generate] fix synced_gpus default (#15446)
stas00 Jan 31, 2022
af5c332
remove "inputs" in tf common test script (no longer required) (#15262)
ydshieh Feb 1, 2022
dc05dd5
Fix TF Causal LM models' returned logits (#15256)
ydshieh Feb 1, 2022
2ca6268
fix from_vision_text_pretrained doc example (#15453)
ydshieh Feb 1, 2022
1c9648c
[M2M100, XGLM] fix positional emb resize (#15444)
patil-suraj Feb 1, 2022
d2749cf
Update README.md (#15462)
kamalkraj Feb 1, 2022
6d585fe
replace assert with exception for padding_side arg in `PreTrainedToke…
SaulLu Feb 1, 2022
7b8bdd8
fix the `tokenizer_config.json` file for the slow tokenizer when a fa…
SaulLu Feb 1, 2022
f427e75
use mean instead of elementwise_mean in XLMPredLayer (#15436)
ydshieh Feb 1, 2022
37800f1
[BartTokenizer] remove inheritance on RobertaTokenizer (#15461)
patil-suraj Feb 1, 2022
8e5d4e4
`Trainer.push_to_hub` always tries to push to the Hub (#15463)
sgugger Feb 1, 2022
d0b5ed1
Harder check for IndexErrors in QA scripts (#15438)
sgugger Feb 1, 2022
c157c7e
Update fine-tune docs (#15259)
stevhliu Feb 2, 2022
b9418a1
Update tutorial docs (#15165)
stevhliu Feb 2, 2022
1d94d57
Add option to resize like torchvision's Resize (#15419)
NielsRogge Feb 2, 2022
d718c0c
[Wav2Vec2ProcessorWithLM] add alpha & beta to batch decode & decode (…
patrickvonplaten Feb 2, 2022
623d8cb
Adding support for `microphone` streaming within pipeline. (#15046)
Narsil Feb 2, 2022
44b21f1
Save code of registered custom models (#15379)
sgugger Feb 2, 2022
dd360d5
fix error posted in issue #15448 (#15480)
bugface Feb 2, 2022
13297ac
Fic docstring of ASR pipeline (#15481)
sgugger Feb 2, 2022
c74f3d4
Add W&B backend for hyperparameter sweep (#14582)
AyushExel Feb 2, 2022
45cac3f
Fix labels stored in model config for token classification examples (…
sgugger Feb 2, 2022
39b5d1a
fix set truncation attribute in `__init__` of `PreTrainedTokenizerBas…
SaulLu Feb 2, 2022
5ec368d
Correct eos_token_id settings in generate (#15403)
thinksoso Feb 2, 2022
71dccd0
fix (#15494)
ydshieh Feb 3, 2022
f5d98da
fix load_weight_prefix (#15101)
ydshieh Feb 3, 2022
e2b6e73
[Flax tests] Disable scheduled GPU tests (#15503)
patrickvonplaten Feb 3, 2022
9016612
Add general vision docstrings (#15501)
NielsRogge Feb 3, 2022
4f5faaf
[deepspeed] fix a bug in a test (#15493)
stas00 Feb 3, 2022
f1a4c4e
[WIP] Add preprocess_logits_for_metrics Trainer param (#15473)
davidleonfdez Feb 3, 2022
21dcaec
[deepspeed docs] memory requirements (#15506)
stas00 Feb 3, 2022
525dbbf
Remove loss from some flax models docs & examples (#15492)
ydshieh Feb 3, 2022
486260c
use kwargs (#15509)
ydshieh Feb 4, 2022
854a0d5
Handle PyTorch to Flax conversion of 1D convolutions (#15519)
sanchit-gandhi Feb 4, 2022
bbe9c69
Fix TFRemBertEncoder all_hidden_states (#15510)
ydshieh Feb 4, 2022
31be2f4
[deepspeed docs] Megatron-Deepspeed info (#15488)
stas00 Feb 4, 2022
ac6aa10
Standardize semantic segmentation models outputs (#15469)
sgugger Feb 4, 2022
8ce1330
[deepspeed docs] DeepSpeed ZeRO Inference (#15486)
stas00 Feb 4, 2022
e02bdce
Revert "Handle PyTorch to Flax conversion of 1D convolutions (#15519)…
patrickvonplaten Feb 7, 2022
5f1918a
[ASR pipeline] correct asr pipeline for seq2seq models (#15541)
patrickvonplaten Feb 7, 2022
c47d259
[torch_int_div] Correct true division in generation (#15498)
patrickvonplaten Feb 7, 2022
84eec9e
Add ConvNeXT (#15277)
NielsRogge Feb 7, 2022
75b13f8
[Trainer] Deeper length checks for IterableDatasetShard (#15539)
anton-l Feb 7, 2022
a459f7f
Add ASR CTC streaming example (#15309)
anton-l Feb 7, 2022
7a1412e
Wav2Vec2 models must either throw or deal with add_apater (#15409)
FremyCompany Feb 7, 2022
6775b21
Remove Longformers from ONNX-supported models (#15273)
lewtun Feb 7, 2022
131e258
Fix TF T5/LED missing cross attn in retrun values (#15511)
ydshieh Feb 7, 2022
ad1d3c4
Make TF Wav2Vec2 outputs the same as PT's version (#15530)
ydshieh Feb 7, 2022
552f8d3
Create a custom model guide (#15489)
stevhliu Feb 7, 2022
0fe17f3
FX tracing improvement (#14321)
michaelbenayoun Feb 7, 2022
87d08af
electra is added to onnx supported model (#15084)
aaron-dunamu Feb 8, 2022
0acd84f
[GPTJ] fix docs (#15558)
patil-suraj Feb 8, 2022
6a5472a
Force use_cache to be False in PyTorch (#15385)
ydshieh Feb 8, 2022
8406fa6
Add TFSpeech2Text (#15113)
gante Feb 8, 2022
077c00c
feat(flax): allow encoder_outputs in generate (#15554)
borisdayma Feb 8, 2022
fcb4f11
:memo: Add codecarbon callback to docs (#15563)
nateraw Feb 8, 2022
a6885db
[Flax tests] fix test_model_outputs_equivalence (#15571)
patil-suraj Feb 9, 2022
ba3f9a7
logger.warn --> logger.warning (#15572)
ydshieh Feb 9, 2022
b5c6fde
PoC for a ProcessorMixin class (#15549)
sgugger Feb 9, 2022
d923f76
add model scaling section (#15119)
lvwerra Feb 9, 2022
7732d0f
Upgrade black to version ~=22.0 (#15565)
LysandreJik Feb 9, 2022
1f60bc4
Make sure custom configs work with Transformers (#15569)
sgugger Feb 9, 2022
9e00566
Add Wav2Vec2 Adapter Weights to Flax (#15566)
sanchit-gandhi Feb 9, 2022
7029240
Upgrade click version (#15579)
LysandreJik Feb 9, 2022
f588cf4
[Flax tests/FlaxBert] make from_pretrained test faster (#15561)
patil-suraj Feb 9, 2022
0113aae
Add implementation of typical sampling (#15504)
cimeister Feb 9, 2022
2b5603f
Constrained Beam Search [without disjunctive decoding] (#15416)
cwkeam Feb 9, 2022
eed3186
Trigger doc build
sgugger Feb 9, 2022
b1ba03e
Fix quality
sgugger Feb 9, 2022
315e674
Fix tests hub failure (#15580)
sgugger Feb 9, 2022
2584808
update serving_output for some TF models (#15568)
ydshieh Feb 9, 2022
dee17d5
[trainer docs] document how to select specific gpus (#15551)
stas00 Feb 9, 2022
a86ee22
Add link (#15588)
NielsRogge Feb 9, 2022
c722753
Expand tutorial for custom models (#15587)
sgugger Feb 9, 2022
644ec05
Make slow tests slow
sgugger Feb 10, 2022
e923917
Reformat tokenization_fnet
LysandreJik Feb 10, 2022
cb7ed6e
Add Tensorflow handling of ONNX conversion (#13831)
Albertobegue Feb 10, 2022
3d5dea9
Add example batch size to all commands (#15596)
patrickvonplaten Feb 10, 2022
724e51c
Compute loss independent from decoder for TF EncDec models (as #14139…
ydshieh Feb 10, 2022
3a2ed96
Fix Seq2SeqTrainer (#15603)
NielsRogge Feb 10, 2022
2e8b85f
Add local and TensorFlow ONNX export examples to docs (#15604)
lewtun Feb 10, 2022
c0864d9
Correct JSON format (#15600)
ngoquanghuy99 Feb 10, 2022
45c7b5b
[Generate] Small refactor (#15611)
patrickvonplaten Feb 10, 2022
6cf06d1
Mark "code in the Hub" API as experimental (#15624)
sgugger Feb 11, 2022
7e4844f
Enable ONNX export when PyTorch and TensorFlow installed in the same …
lewtun Feb 11, 2022
3fae83d
TF: Add informative warning for inexistent CPU backprop ops (#15612)
gante Feb 11, 2022
8c03df1
Rebase (#15606)
mishig25 Feb 11, 2022
2f40c72
TF MT5 embeddings resize (#15567)
gante Feb 11, 2022
85aee09
🖍 remove broken link (#15615)
stevhliu Feb 11, 2022
2dce350
Fix _configuration_file argument getting passed to model (#15629)
sgugger Feb 11, 2022
f15c99f
[deepspeed docs] misc additions (#15585)
stas00 Feb 11, 2022
fcb0f74
[research_projects] deal with security alerts (#15594)
stas00 Feb 11, 2022
7a32e47
Custom feature extractor (#15630)
sgugger Feb 11, 2022
4f403ea
Fix grammar in tokenizer_summary (#15614)
derenrich Feb 11, 2022
52d2e6f
Add push to hub to feature extractor (#15632)
sgugger Feb 11, 2022
f52746d
[Fix doc example] FlaxVisionEncoderDecoder (#15626)
ydshieh Feb 14, 2022
2b8599b
Fix a bug that ignores max_seq_len in preprocess (#15238)
wptoux Feb 14, 2022
ec15da2
Report only the failed imports in `requires_backends` (#15636)
tkukurin Feb 14, 2022
b090b79
Make Swin work with VisionEncoderDecoderModel (#15527)
NielsRogge Feb 14, 2022
0f71c29
Remove redundant error logging in from_pretrained() method (#15631)
lewtun Feb 14, 2022
2e11a04
Register feature extractor (#15634)
sgugger Feb 14, 2022
e314c19
fix bug for the log of RNG states are not properly loaded exception…
muzhi1991 Feb 15, 2022
041fdc4
[SpeechEncoderDecoder] Make sure no EOS is generated in test (#15655)
patrickvonplaten Feb 15, 2022
41168a4
logger doc
FrancescoSaverioZuppichini Feb 15, 2022
05a8580
Revert "logger doc"
FrancescoSaverioZuppichini Feb 15, 2022
e1cbc07
Require tokenizers>=0.11.1 (#15266)
aphedges Feb 15, 2022
9eb7e9b
Fix ASR pipelines from local directories with wav2vec models that hav…
versae Feb 15, 2022
86a7845
Fix typo in speech2text2 doc (#15617)
jonrbates Feb 15, 2022
45f5658
Allow custom code for Processors (#15649)
sgugger Feb 15, 2022
67047b8
add scores to Wav2Vec2WithLMOutput (#15413)
arampacha Feb 15, 2022
7bc4a01
Update bad_words_ids usage (#15641)
ngoquanghuy99 Feb 15, 2022
80f1a59
updated with latest PL and Ray (#15653)
Feb 15, 2022
f45ac11
Add section about doc testing (#15659)
patrickvonplaten Feb 15, 2022
5d8be09
Fix quality
sgugger Feb 15, 2022
28e6155
add a network debug script and document it (#15652)
stas00 Feb 15, 2022
cdf19c5
Re-export `KeyDataset`. (#15645)
Narsil Feb 15, 2022
a3dbbc3
Add `decoder_kwargs` to send to LM on asr pipeline. (#15646)
Narsil Feb 15, 2022
2e12b90
TF generate refactor - Greedy Search (#15562)
patrickvonplaten Feb 15, 2022
faf4ff5
[pipeline doc] fix api (#15660)
stas00 Feb 15, 2022
1690319
Fix TFSequenceSummary's activation (#15643)
ydshieh Feb 15, 2022
943e2aa
Fix model equivalence tests (#15670)
LysandreJik Feb 15, 2022
1ddf3c2
Fix vit test (#15671)
LysandreJik Feb 15, 2022
e3d1a8d
Add a missing space in a deprecation message (#15651)
bryant1410 Feb 16, 2022
bee361c
[t5/t0/mt5 models] faster/leaner custom layer norm (#14656)
stas00 Feb 16, 2022
2d02f7b
Add push_to_hub method to processors (#15668)
sgugger Feb 16, 2022
b87c044
Usage examples for logger (#15657)
FrancescoSaverioZuppichini Feb 16, 2022
d4692ad
Fix dec_attn_mask in TFTransfoXLMainLayer (#15665)
ydshieh Feb 16, 2022
bc3379e
🔥 Remove build_doc_test github action (#15680)
coyotte508 Feb 16, 2022
cdc51ff
Add register method to AutoProcessor (#15669)
sgugger Feb 16, 2022
3a4376d
[Wav2Vec2ProcessorWithLM] Fix auto processor with lm (#15683)
patrickvonplaten Feb 16, 2022
66828a1
Fix Funnel configuration doc (#15686)
ydshieh Feb 16, 2022
f65fe36
Implementation of activations as pytorch modules (#15616)
eldarkurtic Feb 16, 2022
0e91f88
Add image classification notebook (#15667)
NielsRogge Feb 17, 2022
f84e0db
Add PoolFormer (#15531)
tanaymeh Feb 17, 2022
92a537d
Minor fix on README.md (#15688)
ydshieh Feb 17, 2022
426b962
Fix shapes in model docstrings (#15696)
gchhablani Feb 17, 2022
5788217
Add SimMIM (#15586)
NielsRogge Feb 17, 2022
240cc6c
Adding a model, more doc for pushing to the hub (#15690)
FrancescoSaverioZuppichini Feb 18, 2022
e93763d
fix CLIP fast tokenizer and change some properties of the slow versio…
SaulLu Feb 18, 2022
416dff7
Fix SiluActivation (#15718)
sgugger Feb 18, 2022
f8ff3fa
TF: add initializer_std with a small value in TFFunnelModelTester (#1…
ydshieh Feb 18, 2022
68dec6b
Fix DETR model deprecation warnings for int div (#15702)
gautierdag Feb 18, 2022
2f2fefd
Fix LongformerModel hidden states (#15537)
ydshieh Feb 18, 2022
ae1f835
Add PLBart (#13269)
gchhablani Feb 18, 2022
d5083c3
style_doc handles decorators in examples (#15719)
sgugger Feb 18, 2022
83f45cd
Fix auto (#15706)
LysandreJik Feb 18, 2022
3de1290
fix: hfdeepspeed config argument (#15711)
jaketae Feb 18, 2022
60ba482
fix bug in PT speech-encoder-decoder (#15699)
sanchit-gandhi Feb 18, 2022
2c2a31f
Add missing PLBart entry in README (#15721)
gchhablani Feb 18, 2022
a63bd36
Remove input and target reset after preprocessing (#15741)
SSardorf Feb 21, 2022
5444687
Fix minor comment typos (#15740)
Crabzmatic Feb 21, 2022
86119c1
add VisionTextDualEncoder and CLIP fine-tuning script (#15701)
patil-suraj Feb 21, 2022
142b69f
Add layer_idx to CrossAttention of GPT2 model (#15730)
hyunwoongko Feb 21, 2022
3956b13
TF text classification examples (#15704)
gante Feb 21, 2022
0187c6f
revert temporary addition to test next version of CLIPTokenizerFast (…
SaulLu Feb 21, 2022
38bed91
added link to our writing-doc document (#15756)
FrancescoSaverioZuppichini Feb 22, 2022
2c3fcc6
TF train_step docstring (#15755)
gante Feb 22, 2022
32295b1
Gelu10 (#15676)
mfuntowicz Feb 22, 2022
c44d367
Time stamps for CTC models (#15687)
patrickvonplaten Feb 22, 2022
2cdb6db
fixed pipeline code (#15607)
Moumeneb1 Feb 22, 2022
3db2e8f
Fix typo on examples/pytorch/question-answering (#15644)
dreamgonfly Feb 22, 2022
db57bb2
Cleanup transformers-cli (#15767)
julien-c Feb 22, 2022
05a12a0
Fix `HfArgumentParser` when passing a generator (#15758)
bryant1410 Feb 22, 2022
f9582c2
Adding ZeroShotImageClassificationPipeline (#12119)
Narsil Feb 23, 2022
24588c6
[M2M100, XGLM] fix create_position_ids_from_inputs_embeds (#15751)
patil-suraj Feb 23, 2022
a3e607d
Supporting Merges.txt files than contain an endline. (#15782)
Narsil Feb 23, 2022
de73786
[CLIP] fix grad ckpt (#15789)
patil-suraj Feb 23, 2022
1b23979
[ViLT] Fix checkpoint url in config (#15790)
patil-suraj Feb 23, 2022
9e71d46
Enable `image-segmentation` on `AutoModelForSemanticSegmentation` (#1…
Narsil Feb 23, 2022
32f5de1
[doc] custom_models: mention security features of the Hub (#15768)
julien-c Feb 23, 2022
3f76bf5
Align documentation with code defaults (#15468)
lsb Feb 23, 2022
a1efc82
HTML dev docs (#15678)
coyotte508 Feb 23, 2022
86636f5
Fix indent in doc-builder CI (#15798)
coyotte508 Feb 23, 2022
fecb08c
🧼 NLP task guides (#15731)
stevhliu Feb 23, 2022
29c10a4
[Test refactor 1/5] Per-folder tests reorganization (#15725)
LysandreJik Feb 23, 2022
0400b22
[Test refactor 2/5] Tests fetcher (#15726)
LysandreJik Feb 23, 2022
d3ae2bd
[Test refactor 3/5] Notification service improvement (#15727)
LysandreJik Feb 23, 2022
4c737f0
[Test refactor 4/5] Improve the scheduled tests (#15728)
LysandreJik Feb 23, 2022
a0e3480
[Test refactor 5/5] Build docker images (#15729)
LysandreJik Feb 23, 2022
6336017
Fix build_documentation CI (#15803)
coyotte508 Feb 23, 2022
c475f3c
Scheduled tests should only run on a daily basis
LysandreJik Feb 23, 2022
309e87e
Docker images should only run on a daily basis
LysandreJik Feb 23, 2022
bb7949b
Fix model templates (#15806)
LysandreJik Feb 23, 2022
7f921bc
Fix add-new-model-like when old model checkpoint is not found (#15805)
sgugger Feb 24, 2022
d1fcc90
Fix from_pretrained with default base_model_prefix (#15814)
sgugger Feb 24, 2022
35ecf99
Revert changes in logit size for semantic segmentation models (#15722)
sgugger Feb 24, 2022
ca57b45
[Unispeech] Fix slow tests (#15818)
patrickvonplaten Feb 24, 2022
2f0f903
[Barthez Tokenizer] Fix saving (#15815)
patrickvonplaten Feb 24, 2022
cbf4391
[TFXLNet] Correct tf xlnet generate (#15822)
patrickvonplaten Feb 24, 2022
b7e292a
Fix the push run (#15807)
LysandreJik Feb 24, 2022
074645e
Fix semantic segmentation pipeline test (#15826)
sgugger Feb 25, 2022
7963578
Fix dummy_inputs() to dummy_inputs in symbolic_trace doc (#15776)
pbelevich Feb 25, 2022
7566734
Add model specific output classes to PoolFormer model docs (#15746)
tanaymeh Feb 25, 2022
ad0d7d1
Adding the option to return_timestamps on pure CTC ASR models. (#15792)
Narsil Feb 25, 2022
4818bf7
HFTracer.trace should use/return self.graph to be compatible with tor…
pbelevich Feb 25, 2022
8635407
Fix tf.concatenate + test past_key_values for TF models (#15774)
ydshieh Feb 25, 2022
bf1fe32
[examples/summarization and translation] fix readme (#15833)
patil-suraj Feb 25, 2022
fd5b05e
Add ONNX Runtime quantization for text classification notebook (#15817)
echarlaix Feb 25, 2022
0118c4f
Re-enable doctests for the quicktour (#15828)
sgugger Feb 25, 2022
0b5bf6a
Framework split model report (#15825)
LysandreJik Feb 25, 2022
84eaa6a
Add TFConvNextModel (#15750)
sayakpaul Feb 25, 2022
935a76d
[UniSpeechSat] correct unispeech sat (#15847)
patrickvonplaten Feb 28, 2022
e3342ed
Flax Speech-Encoder-Decoder Model (#15613)
sanchit-gandhi Feb 28, 2022
410e26c
Fix (deprecated) ONNX exporter to account for new tf2onnx API (#15856)
lewtun Feb 28, 2022
97f9b8a
Fixing the timestamps with chunking. (#15843)
Narsil Feb 28, 2022
ddbb485
[TF-PT-Tests] Fix PyTorch - TF tests for different GPU devices (#15846)
patrickvonplaten Feb 28, 2022
df5a409
Add Data2Vec (#15507)
edugp Mar 1, 2022
9863f7d
[Benchmark tools] Deprecate all (#15848)
patrickvonplaten Mar 1, 2022
54f0db4
Add PT + TF automatic builds (#15860)
LysandreJik Mar 1, 2022
3f2e636
Update TF LM examples (#15855)
gante Mar 1, 2022
e064f08
Add time stamps for wav2vec2 with lm (#15854)
patrickvonplaten Mar 1, 2022
c008afe
Add link to notebooks (#15791)
NielsRogge Mar 1, 2022
7ff9d45
Scatter should run on CUDA (#15872)
LysandreJik Mar 1, 2022
286fdc6
[vision] Add problem_type support (#15851)
NielsRogge Mar 1, 2022
afca0d5
use python 3.7 for flax self-push tests (#15865)
patil-suraj Mar 1, 2022
00eaffc
Bump up doc node version to 16 (#15874)
mishig25 Mar 1, 2022
2642692
No self-hosted runner for dev documentation (#15710)
LysandreJik Mar 1, 2022
6ccfa21
Inference for multilingual models (#15836)
stevhliu Mar 1, 2022
b842d72
fix deepspeed tests (#15881)
stas00 Mar 2, 2022
d1a2907
Remove stash for now (#15882)
LysandreJik Mar 2, 2022
4bfe75b
M2M100 support for ONNX export (#15193)
michaelbenayoun Mar 2, 2022
4004072
[Bart] Fix implementation note doc (#15879)
patrickvonplaten Mar 2, 2022
8a13349
Add TF generate sample tests with all logit processors (#15852)
gante Mar 2, 2022
6e57a56
Adding timestamps for CTC with LM in ASR pipeline. (#15863)
Narsil Mar 2, 2022
05c237e
Update TF QA example (#15870)
gante Mar 2, 2022
2eb7bb1
Updates in Trainer to support new features in SM Model Parallel libra…
rahul003 Mar 2, 2022
e535c38
Fix tiny typo (#15884)
rhjohnstone Mar 2, 2022
d83d22f
Maskformer (#15682)
FrancescoSaverioZuppichini Mar 2, 2022
8fd4731
Fix Bug in FlaxWav2Vec2 Slow Test (#15887)
sanchit-gandhi Mar 2, 2022
96ae92b
[SegFormer] Add deprecation warning (#15889)
NielsRogge Mar 2, 2022
baab5e7
TF generate refactor - Sample (#15793)
gante Mar 2, 2022
130b987
[XGLM] run sampling test on CPU to be deterministic (#15892)
patil-suraj Mar 2, 2022
89be34c
Fix SegformerForImageClassification (#15895)
NielsRogge Mar 2, 2022
3d22428
Update delete-dev-doc job to match build-dev-doc (#15891)
sgugger Mar 2, 2022
7e8ae01
Release: v4.17.0
sgugger Mar 2, 2022
8529a85
[Fix link in pipeline doc] (#15906)
patrickvonplaten Mar 3, 2022
198c335
[Doctests] Fix ignore bug and add more doc tests (#15911)
patrickvonplaten Mar 3, 2022
bfa6546
remove files from 'v4.17.0' before merge
calpt Mar 23, 2022
d3e3977
Merge stripped branch 'v4.17.0'
calpt Mar 23, 2022
ac17f31
Post-merge fixes
calpt Mar 23, 2022
8cbaeac
workflow_dispatch for tests
calpt Mar 23, 2022
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
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/workflows/tests_torch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
- 'templates/**'
- 'tests/**'
- 'utils/**'
workflow_dispatch:

jobs:
check_code_quality:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,6 @@ scripts/git-strip-merge

# .lock
*.lock

# DS_Store (MacOS)
.DS_Store
72 changes: 55 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,51 +175,82 @@ Follow these steps to start contributing:
5. Develop the features on your branch.

As you work on the features, you should make sure that the test suite
passes:
passes. You should run the tests impacted by your changes like this:

```bash
$ pytest tests/<TEST_TO_RUN>.py
```

You can also run the full suite with the following command, but it takes
a beefy machine to produce a result in a decent amount of time now that
Transformers has grown a lot. Here is the command for it:

```bash
$ 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:
For more information about tests, check out the
[dedicated documentation](https://huggingface.co/docs/transformers/testing)

🤗 Transformers relies on `black` and `isort` to format its source code
consistently. After you make changes, apply automatic style corrections and code verifications
that can't be automated in one go with:

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

Adjust the value of `-n` to fit the load your hardware can support.
This target is also optimized to only work with files modified by the PR you're working on.

`adapter-transformers` relies on `black` and `isort` to format its source code
consistently. After you make changes, format them with:
If you prefer to run the checks one after the other, the following command apply the
style corrections:

```bash
$ make style
```

`adapter-transformers` also uses `flake8` to check for coding mistakes. Quality
`adapter-transformers` also uses `flake8` and a few custom scripts to check for coding mistakes. Quality
control runs in CI, however you can also run the same checks with:

```bash
$ make quality
```
You can do the automatic style corrections and code verifications that can't be automated in one go:

Finally we have a lot of scripts that check we didn't forget to update
some files when adding a new model, that you can run with

```bash
$ make fixup
$ make repo-consistency
```

This target is also optimized to only work with files modified by the PR you're working on.
To learn more about those checks and how to fix any issue with them, check out the
[documentation](https://huggingface.co/docs/transformers/pr_checks)

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:
make sure you have installed the documentation builder requirements. First you will need to clone the
repository containing our tools to build the documentation:

```bash
$ pip install git+https://github.com/huggingface/doc-builder
```

Then, make sure you have all the dependencies to be able to build the doc with:

```bash
$ make docs
$ pip install ".[docs]"
```

Finally run the following command from the root of the repository:

```bash
$ doc-builder build transformers docs/source/ --build_dir ~/tmp/test-build
```

This will build the documentation in the `~/tmp/test-build` folder where you can inspect the generated
Markdown files with your favorite editor. You won't be able to see the final rendering on the website
before your PR is merged, we are actively working on adding a tool for this.

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 @@ -273,8 +304,15 @@ Follow these steps to start contributing:
- 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_bert.py` for an
example.
7. Due to the rapidly growing repository, it is important to make sure that no files that would significantly weigh down the repository are added. This includes images, videos and other non-text files. We prefer to leverage a hf.co hosted `dataset` like
the ones hosted on [`hf-internal-testing`](https://huggingface.co/hf-internal-testing) in which to place these files and reference
them by URL. We recommend putting them in the following dataset: [huggingface/documentation-images](https://huggingface.co/datasets/huggingface/documentation-images).
If an external contribution, feel free to add the images to your PR and ask a Hugging Face member to migrate your images
to this dataset.

See more about the checks run on a pull request in our [PR guide](pr_checks)

### Tests

Expand Down Expand Up @@ -326,7 +364,7 @@ $ python -m unittest discover -s examples -t examples -v

### Style guide

For documentation strings, `transformers` follows the [google style](https://google.github.io/styleguide/pyguide.html).
For documentation strings, 🤗 Transformers follows the [google style](https://google.github.io/styleguide/pyguide.html).
Check our [documentation writing guide](https://github.com/huggingface/transformers/tree/master/docs#writing-documentation---specification)
for more information.

Expand All @@ -350,7 +388,7 @@ You can now use `make` from any terminal (Powershell, cmd.exe, etc) 🎉

### Syncing forked master with upstream (HuggingFace) master

To avoid pinging the upstream repository which adds reference notes to each upstream PR and sends unnessary notifications to the developers involved in these PRs,
To avoid pinging the upstream repository which adds reference notes to each upstream PR and sends unnecessary notifications to the developers involved in these PRs,
when syncing the master branch of a forked repository, please, follow these steps:
1. When possible, avoid syncing with the upstream using a branch and PR on the forked repository. Instead merge directly into the forked master.
2. If a PR is absolutely necessary, use the following steps after checking out your branch:
Expand Down
16 changes: 6 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@ deps_table_check_updated:

autogenerate_code: deps_table_update

# Check that source code meets quality standards
# Check that the repo is in a good state

# NOTE FOR adapter-transformers: The following check is skipped as not all copies implement adapters yet
# python utils/check_copies.py
# python utils/check_table.py
# python utils/check_dummies.py
# python utils/tests_fetcher.py --sanity_check
extra_quality_checks:
repo-consistency:
python utils/check_repo.py
python utils/check_inits.py
python utils/check_adapters.py

# this target runs checks on all files

quality:
black --check $(check_dirs)
isort --check-only $(check_dirs)
python utils/custom_init_isort.py --check_only
flake8 $(check_dirs)
${MAKE} extra_quality_checks
python utils/style_doc.py src/transformers docs/source --max_len 119 --check_only

# Format source code automatically and check is there are any problems left that need manual fixing

Expand All @@ -58,6 +58,7 @@ extra_style_checks:
python utils/style_doc.py src/transformers docs/source --max_len 119

# this target runs checks on all files and potentially modifies some of them

style:
black $(check_dirs)
isort $(check_dirs)
Expand All @@ -66,7 +67,7 @@ style:

# Super fast fix and check target that only works on relevant modified files since the branch was made

fixup: modified_only_fixup extra_style_checks autogenerate_code extra_quality_checks
fixup: modified_only_fixup extra_style_checks autogenerate_code repo-consistency

# Make marked copies of snippets of codes conform to the original

Expand Down Expand Up @@ -96,11 +97,6 @@ test-sagemaker: # install sagemaker dependencies in advance with pip install .[s
TEST_SAGEMAKER=True python -m pytest -n auto -s -v ./tests/sagemaker


# Check that docs can build

docs:
cd docs && make html SPHINXOPTS="-W -j 4"

# Release stuff

pre-release:
Expand Down
19 changes: 18 additions & 1 deletion tests/conftest.py → conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
# tests directory-specific settings - this file is run automatically
# by pytest before any tests are run

import doctest
import sys
import warnings
from os.path import abspath, dirname, join


# allow having multiple repository checkouts and not needing to remember to rerun
# 'pip install -e .[dev]' when switching between checkouts and running tests.
git_repo_path = abspath(join(dirname(dirname(__file__)), "src"))
git_repo_path = abspath(join(dirname(__file__), "src"))
sys.path.insert(1, git_repo_path)

# silence FutureWarning warnings in tests since often we can't act on them until
Expand Down Expand Up @@ -59,3 +60,19 @@ def pytest_sessionfinish(session, exitstatus):
# If no tests are collected, pytest exists with code 5, which makes the CI fail.
if exitstatus == 5:
session.exitstatus = 0


# Doctest custom flag to ignore output.
IGNORE_RESULT = doctest.register_optionflag('IGNORE_RESULT')

OutputChecker = doctest.OutputChecker


class CustomOutputChecker(OutputChecker):
def check_output(self, want, got, optionflags):
if IGNORE_RESULT & optionflags:
return True
return OutputChecker.check_output(self, want, got, optionflags)


doctest.OutputChecker = CustomOutputChecker
22 changes: 22 additions & 0 deletions docker/transformers-all-latest-gpu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM nvidia/cuda:11.2.2-cudnn8-runtime-ubuntu20.04
LABEL maintainer="Hugging Face"

ARG DEBIAN_FRONTEND=noninteractive

RUN apt update
RUN apt install -y git libsndfile1-dev tesseract-ocr espeak-ng python3 python3-pip ffmpeg
RUN python3 -m pip install --no-cache-dir --upgrade pip

ARG REF=master
RUN git clone https://github.com/huggingface/transformers && cd transformers && git checkout $REF
RUN python3 -m pip install --no-cache-dir -e ./transformers[dev,onnxruntime]

RUN python3 -m pip install --no-cache-dir -U torch tensorflow
RUN python3 -m pip uninstall -y flax jax
RUN python3 -m pip install --no-cache-dir torch-scatter -f https://data.pyg.org/whl/torch-$(python3 -c "from torch import version; print(version.__version__.split('+')[0])")+cu102.html
RUN python3 -m pip install --no-cache-dir git+https://github.com/facebookresearch/detectron2.git pytesseract https://github.com/kpu/kenlm/archive/master.zip
RUN python3 -m pip install -U "itsdangerous<2.1.0"

# When installing in editable mode, `transformers` is not recognized as a package.
# this line must be added in order for python to be aware of transformers.
RUN cd transformers && python3 setup.py develop
16 changes: 16 additions & 0 deletions docker/transformers-doc-builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM python:3.8
LABEL maintainer="Hugging Face"

RUN apt update
RUN git clone https://github.com/huggingface/transformers

RUN python3 -m pip install --no-cache-dir --upgrade pip && python3 -m pip install --no-cache-dir git+https://github.com/huggingface/doc-builder ./transformers[dev,deepspeed]
RUN apt-get -y update && apt-get install -y libsndfile1-dev && apt install -y tesseract-ocr

RUN python3 -m pip install --no-cache-dir torch-scatter -f https://data.pyg.org/whl/torch-$(python -c "from torch import version; print(version.__version__.split('+')[0])")+cpu.html
RUN python3 -m pip install --no-cache-dir torchvision git+https://github.com/facebookresearch/detectron2.git pytesseract https://github.com/kpu/kenlm/archive/master.zip
RUN python3 -m pip install --no-cache-dir pytorch-quantization --extra-index-url https://pypi.ngc.nvidia.com
RUN python3 -m pip install -U "itsdangerous<2.1.0"

RUN doc-builder build transformers transformers/docs/source --build_dir doc-build-dev --notebook_dir notebooks/transformers_doc --clean --version pr_$PR_NUMBER
RUN rm -rf doc-build-dev
21 changes: 21 additions & 0 deletions docker/transformers-pytorch-deepspeed-latest-gpu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM nvcr.io/nvidia/pytorch:21.03-py3
LABEL maintainer="Hugging Face"

ARG DEBIAN_FRONTEND=noninteractive

RUN apt -y update
RUN apt install -y libaio-dev
RUN python3 -m pip install --no-cache-dir --upgrade pip

ARG REF=master
RUN git clone https://github.com/huggingface/transformers && cd transformers && git checkout $REF
RUN python3 -m pip install --no-cache-dir -e ./transformers[testing,deepspeed]

RUN git clone https://github.com/microsoft/DeepSpeed && cd DeepSpeed && rm -rf build && \
DS_BUILD_CPU_ADAM=1 DS_BUILD_AIO=1 DS_BUILD_UTILS=1 python3 -m pip install -e . --global-option="build_ext" --global-option="-j8" --no-cache -v --disable-pip-version-check 2>&1

# When installing in editable mode, `transformers` is not recognized as a package.
# this line must be added in order for python to be aware of transformers.
RUN cd transformers && python3 setup.py develop

RUN python3 -c "from deepspeed.launcher.runner import main"
44 changes: 20 additions & 24 deletions docker/transformers-pytorch-gpu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
FROM nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04
FROM nvidia/cuda:11.2.2-cudnn8-runtime-ubuntu20.04
LABEL maintainer="Hugging Face"
LABEL repository="transformers"

RUN apt update && \
apt install -y bash \
build-essential \
git \
curl \
ca-certificates \
python3 \
python3-pip && \
rm -rf /var/lib/apt/lists
ARG DEBIAN_FRONTEND=noninteractive

RUN python3 -m pip install --no-cache-dir --upgrade pip && \
python3 -m pip install --no-cache-dir \
mkl \
torch
RUN apt update
RUN apt install -y git libsndfile1-dev tesseract-ocr espeak-ng python3 python3-pip ffmpeg
RUN python3 -m pip install --no-cache-dir --upgrade pip

RUN git clone https://github.com/NVIDIA/apex
RUN cd apex && \
python3 setup.py install && \
pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./
ARG REF=master
RUN git clone https://github.com/huggingface/transformers && cd transformers && git checkout $REF
RUN python3 -m pip install --no-cache-dir -e ./transformers[dev-torch,testing]

WORKDIR /workspace
COPY . transformers/
RUN cd transformers/ && \
python3 -m pip install --no-cache-dir .
# If set to nothing, will install the latest version
ARG PYTORCH=''

CMD ["/bin/bash"]
RUN [ ${#PYTORCH} -gt 0 ] && VERSION='torch=='$PYTORCH'.*' || VERSION='torch'; python3 -m pip install --no-cache-dir -U $VERSION
RUN python3 -m pip uninstall -y tensorflow flax

RUN python3 -m pip install --no-cache-dir torch-scatter -f https://data.pyg.org/whl/torch-$(python3 -c "from torch import version; print(version.__version__.split('+')[0])")+cu102.html
RUN python3 -m pip install --no-cache-dir git+https://github.com/facebookresearch/detectron2.git pytesseract https://github.com/kpu/kenlm/archive/master.zip
RUN python3 -m pip install -U "itsdangerous<2.1.0"

# When installing in editable mode, `transformers` is not recognized as a package.
# this line must be added in order for python to be aware of transformers.
RUN cd transformers && python3 setup.py develop
Loading